From e79444f09a36e70f54a3bf370bf29aa01d9c72d7 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Sat, 3 May 2014 00:06:07 +0200 Subject: [PATCH] more tests --- ci/test-12-option-type.pl | 4 ++-- src/fping.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) 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; -- 2.43.0