]> git.gsnw.org Git - fping.git/commitdiff
more tests
authorDavid Schweikert <david@schweikert.ch>
Fri, 2 May 2014 22:06:07 +0000 (00:06 +0200)
committerDavid Schweikert <david@schweikert.ch>
Fri, 2 May 2014 22:06:07 +0000 (00:06 +0200)
ci/test-12-option-type.pl
src/fping.c

index d6e32119ab42540673d629ef5f45217ffcaf08f5..f3c8c2fd2ed852e932478b59ec30813d8f88297f 100755 (executable)
@@ -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 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("");
index d79d2eb7bd7d25c3e9561ebb813cd6d74f201b25..cf8d5db458abed1d3fef4d790087199480cb694f 100644 (file)
@@ -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;