From 7e55f0b0739eae9e53e3bca52af16ac4b6538dec Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 23 Jul 2013 23:40:17 +0200 Subject: [PATCH] Fix loop issue after 65536 pings (reported by Peter Folk and GBert, #12), Minimum ping data size is now 0 --- ChangeLog | 4 ++++ src/fping.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e4695dc..caf7968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +UNRELEASED + * Fix loop issue after 65536 pings (reported by Peter Folk and GBert, #12) + * Minimum ping data size is now 0 + 2013-05-22 David Schweikert * Version 3.5 * Fix sprint_tm buffer size crash (reported by Japheth Cleaver) diff --git a/src/fping.c b/src/fping.c index c2bfb3c..f9a5978 100644 --- a/src/fping.c +++ b/src/fping.c @@ -526,7 +526,9 @@ int main( int argc, char **argv ) break; case 'b': - if( !( ping_data_size = ( unsigned int )atoi( optarg ) ) ) + errno = 0; + ping_data_size = (unsigned int) strtol(optarg, (char **)NULL, 10); + if( errno ) usage(1); break;