/[inetutils]/inetutils/ping/ping.c
ViewVC logotype

Diff of /inetutils/ping/ping.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by gray, Fri Jul 29 17:13:48 2005 UTC revision 1.24 by ams, Fri Jul 29 19:06:08 2005 UTC
# Line 99  static void show_usage (void); Line 99  static void show_usage (void);
99  static void decode_type (const char *optarg);  static void decode_type (const char *optarg);
100  static int send_echo (PING *ping);  static int send_echo (PING *ping);
101    
 static size_t  
 ping_cvt_number (const char *optarg, size_t maxval, int allow_zero)  
 {  
   char *p;  
   size_t n;  
     
   n = strtoul (optarg, &p, 0);  
   if (*p)  
     {  
       fprintf (stderr, "Invalid value (`%s' near `%s')\n", optarg, p);  
       exit (1);  
     }  
   if (n == 0 && !allow_zero)  
     {  
       fprintf (stderr, "Option value too small: %s\n", optarg);  
       exit (1);  
     }  
   if (maxval && n > maxval)  
     {  
       fprintf (stderr, "Option value too big: %s\n", optarg);  
       exit (1);  
     }  
   return n;  
 }  
   
102  int  int
103  main (int argc, char **argv)  main (int argc, char **argv)
104  {  {

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26