mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-04 20:34:14 +00:00
Make sure to check argc before use argv.
This commit is contained in:
parent
76f3169ec4
commit
b401af895c
@ -366,9 +366,9 @@ int transfer_bytes(struct radio_state *radios)
|
|||||||
|
|
||||||
int main(int argc,char **argv)
|
int main(int argc,char **argv)
|
||||||
{
|
{
|
||||||
if (argv[1]) {
|
if (1 < argc) {
|
||||||
chars_per_ms=atol(argv[1]);
|
chars_per_ms=atol(argv[1]);
|
||||||
if (argv[2])
|
if (2 < argc)
|
||||||
ber=atol(argv[2]);
|
ber=atol(argv[2]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Sending %d bytes per ms\n", chars_per_ms);
|
fprintf(stderr, "Sending %d bytes per ms\n", chars_per_ms);
|
||||||
|
Loading…
Reference in New Issue
Block a user