fix some coverity warnings

This commit is contained in:
Miroslav Lichvar
2017-01-09 13:43:26 +01:00
parent 8f7ab95ff0
commit a7802e9a76
3 changed files with 8 additions and 4 deletions

View File

@@ -2723,7 +2723,8 @@ process_cmd_waitsync(char *line)
max_skew_ppm = 0.0;
interval = 10.0;
sscanf(line, "%d %lf %lf %lf", &max_tries, &max_correction, &max_skew_ppm, &interval);
if (sscanf(line, "%d %lf %lf %lf", &max_tries, &max_correction, &max_skew_ppm, &interval))
;
/* Don't allow shorter interval than 0.1 seconds */
if (interval < 0.1)
@@ -2831,7 +2832,8 @@ process_cmd_keygen(char *line)
snprintf(hash_name, sizeof (hash_name), "MD5");
#endif
sscanf(line, "%u %16s %d", &id, hash_name, &bits);
if (sscanf(line, "%u %16s %d", &id, hash_name, &bits))
;
length = CLAMP(10, (bits + 7) / 8, sizeof (key));
if (HSH_GetHashId(hash_name) < 0) {