diff --git a/src/fping.c b/src/fping.c index c58e20c5..4d2dd5ab 100644 --- a/src/fping.c +++ b/src/fping.c @@ -605,7 +605,7 @@ int main(int argc, char **argv) break; case 't': - if (!sscanf(optparse_state.optarg, "%f", &opt_value_float)) + if (sscanf(optparse_state.optarg, "%f", &opt_value_float) != 1) usage(1); if (opt_value_float < 0) { usage(1); @@ -615,12 +615,12 @@ int main(int argc, char **argv) break; case 'r': - if (!sscanf(optparse_state.optarg, "%u", &retry)) + if (sscanf(optparse_state.optarg, "%u", &retry) != 1) usage(1); break; case 'i': - if (!sscanf(optparse_state.optarg, "%f", &opt_value_float)) + if (sscanf(optparse_state.optarg, "%f", &opt_value_float) != 1) usage(1); if (opt_value_float < 0) { usage(1); @@ -629,7 +629,7 @@ int main(int argc, char **argv) break; case 'p': - if (!sscanf(optparse_state.optarg, "%f", &opt_value_float)) + if (sscanf(optparse_state.optarg, "%f", &opt_value_float) != 1) usage(1); if (opt_value_float < 0) { usage(1); @@ -654,7 +654,7 @@ int main(int argc, char **argv) break; case 'b': - if (!sscanf(optparse_state.optarg, "%u", &ping_data_size)) + if (sscanf(optparse_state.optarg, "%u", &ping_data_size) != 1) usage(1); break; @@ -671,7 +671,7 @@ int main(int argc, char **argv) case 'Q': verbose_flag = 0; quiet_flag = 1; - if (!sscanf(optparse_state.optarg, "%f", &opt_value_float)) + if (sscanf(optparse_state.optarg, "%f", &opt_value_float) != 1) usage(1); if (opt_value_float < 0) { usage(1); @@ -849,7 +849,7 @@ int main(int argc, char **argv) break; case 'O': - if (sscanf(optparse_state.optarg, "%i", &tos)) { + if (sscanf(optparse_state.optarg, "%i", &tos) == 1) { if (socket4 >= 0) { if (setsockopt(socket4, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))) { perror("setting type of service octet IP_TOS");