mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-02-05 06:45:01 +01:00
fix off-by-one in argument handling
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
e07189cea1
commit
6b99aedc4d
@ -141,7 +141,7 @@ int main(int argc, char **argv)
|
|||||||
filename = argv[optind];
|
filename = argv[optind];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(argc <5)
|
if(argc <6)
|
||||||
usage();
|
usage();
|
||||||
dev_index = atoi(argv[1]);
|
dev_index = atoi(argv[1]);
|
||||||
samp_rate = atoi(argv[2])*1000;
|
samp_rate = atoi(argv[2])*1000;
|
||||||
@ -159,7 +159,7 @@ int main(int argc, char **argv)
|
|||||||
"Maximal length: %u\n", MAXIMAL_BUF_LENGTH);
|
"Maximal length: %u\n", MAXIMAL_BUF_LENGTH);
|
||||||
out_block_size = DEFAULT_BUF_LENGTH;
|
out_block_size = DEFAULT_BUF_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = malloc(out_block_size * sizeof(uint8_t));
|
buffer = malloc(out_block_size * sizeof(uint8_t));
|
||||||
|
|
||||||
device_count = rtlsdr_get_device_count();
|
device_count = rtlsdr_get_device_count();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user