diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-05-15 11:08:57 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-05-15 11:35:19 +0200 |
commit | 7a24c1d9cd01316dac341fdd52d29e2e759505eb (patch) | |
tree | 9243bd0b824627a4a560e497f0f4f3eb27e3d71f /tests/dtls | |
parent | ba6784ea2d4ba8396b4c7eecf4c44353dc16d84f (diff) | |
download | gnutls-7a24c1d9cd01316dac341fdd52d29e2e759505eb.tar.gz |
tests: dtls-stress: corrected parsing of -d option
Diffstat (limited to 'tests/dtls')
-rw-r--r-- | tests/dtls/dtls-stress.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/dtls/dtls-stress.c b/tests/dtls/dtls-stress.c index 93f904e290..1b70605c66 100644 --- a/tests/dtls/dtls-stress.c +++ b/tests/dtls/dtls-stress.c @@ -1179,10 +1179,14 @@ int main(int argc, const char *argv[]) batch = 1; } else if (strcmp("-d", argv[arg]) == 0) { char *end; - int level = strtol(argv[arg + 1], &end, 10); - if (*end == '\0') { - debug = level; - arg++; + int level; + + if (arg+1 < argc) { + level = strtol(argv[arg + 1], &end, 10); + if (*end == '\0') { + debug = level; + arg++; + } } else { debug++; } |