projects
/
liboping.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/oping.c: Minor coding style changes.
[liboping.git]
/
src
/
oping.c
diff --git
a/src/oping.c
b/src/oping.c
index
08423ea
..
3ae226c
100644
(file)
--- a/
src/oping.c
+++ b/
src/oping.c
@@
-701,20
+701,16
@@
static int read_options (int argc, char **argv) /* {{{ */
break;
case 'w':
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;
break;
- }
case 'I':
{
case 'I':
{
@@
-1682,7
+1678,7
@@
int main (int argc, char **argv) /* {{{ */
}
#endif
}
#endif
-
setlocale(LC_ALL, "");
+ setlocale(LC_ALL, "");
optind = read_options (argc, argv);
#if !_POSIX_SAVED_IDS
optind = read_options (argc, argv);
#if !_POSIX_SAVED_IDS