summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f4c310)
raw | patch | inline | side by side (parent: 9f4c310)
author | Florian Forster <ff@octo.it> | |
Fri, 13 Feb 2015 12:01:13 +0000 (13:01 +0100) | ||
committer | Florian Forster <ff@octo.it> | |
Fri, 13 Feb 2015 12:01:13 +0000 (13:01 +0100) |
src/oping.c | patch | blob | history |
diff --git a/src/oping.c b/src/oping.c
index 08423eac3887118443b83e87e347284d54ac405b..3ae226c6f5e64d25e31d3ab3d960e0e673a8289f 100644 (file)
--- a/src/oping.c
+++ b/src/oping.c
break;
case 'w':
- {
- char *endp;
- double t = strtod(optarg, &endp);
- if(optarg[0] != '\0' && *endp == '\0')
{
- opt_timeout = t;
- }
- else{
- fprintf (stderr, "Ignoring invalid timeout: %s\n",
- optarg);
+ char *endp = NULL;
+ double t = strtod (optarg, &endp);
+ if ((optarg[0] != 0) && (endp != NULL) && (*endp == 0))
+ opt_timeout = t;
+ else
+ fprintf (stderr, "Ignoring invalid timeout: %s\n",
+ optarg);
}
-
break;
- }
case 'I':
{
}
#endif
- setlocale(LC_ALL, "");
+ setlocale(LC_ALL, "");
optind = read_options (argc, argv);
#if !_POSIX_SAVED_IDS