From: David Schweikert Date: Fri, 2 May 2014 22:06:07 +0000 (+0200) Subject: more tests X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e79444f09a36e70f54a3bf370bf29aa01d9c72d7;p=fping.git more tests --- diff --git a/ci/test-12-option-type.pl b/ci/test-12-option-type.pl index d6e3211..f3c8c2f 100755 --- a/ci/test-12-option-type.pl +++ b/ci/test-12-option-type.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl -w -use Test::Command tests => 33; +use Test::Command tests => 36; -for my $arg (qw(i B c C H i O p Q r t)) { +for my $arg (qw(i b B c C H i O p Q r t)) { my $cmd = Test::Command->new(cmd => "fping -$arg xxx"); $cmd->exit_is_num(1); $cmd->stdout_is_eq(""); diff --git a/src/fping.c b/src/fping.c index d79d2eb..cf8d5db 100644 --- a/src/fping.c +++ b/src/fping.c @@ -424,9 +424,7 @@ int main( int argc, char **argv ) break; case 'b': - errno = 0; - ping_data_size = (unsigned int) strtol(optarg, (char **)NULL, 10); - if( errno ) + if (!sscanf(optarg,"%i",&ping_data_size)) usage(1); break;