mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:25:07 -05:00
fix some coverity warnings
This commit is contained in:
6
client.c
6
client.c
@@ -2723,7 +2723,8 @@ process_cmd_waitsync(char *line)
|
|||||||
max_skew_ppm = 0.0;
|
max_skew_ppm = 0.0;
|
||||||
interval = 10.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 */
|
/* Don't allow shorter interval than 0.1 seconds */
|
||||||
if (interval < 0.1)
|
if (interval < 0.1)
|
||||||
@@ -2831,7 +2832,8 @@ process_cmd_keygen(char *line)
|
|||||||
snprintf(hash_name, sizeof (hash_name), "MD5");
|
snprintf(hash_name, sizeof (hash_name), "MD5");
|
||||||
#endif
|
#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));
|
length = CLAMP(10, (bits + 7) / 8, sizeof (key));
|
||||||
if (HSH_GetHashId(hash_name) < 0) {
|
if (HSH_GetHashId(hash_name) < 0) {
|
||||||
|
|||||||
3
main.c
3
main.c
@@ -325,7 +325,8 @@ go_daemon(void)
|
|||||||
if (r) {
|
if (r) {
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
/* Print the error message from the child */
|
/* Print the error message from the child */
|
||||||
fprintf(stderr, "%.1024s\n", message);
|
message[sizeof (message) - 1] = '\0';
|
||||||
|
fprintf(stderr, "%s\n", message);
|
||||||
}
|
}
|
||||||
exit(1);
|
exit(1);
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -158,7 +158,8 @@ set_sync_status(int synchronised, double est_error, double max_error)
|
|||||||
txc.esterror = est_error * 1.0e6;
|
txc.esterror = est_error * 1.0e6;
|
||||||
txc.maxerror = max_error * 1.0e6;
|
txc.maxerror = max_error * 1.0e6;
|
||||||
|
|
||||||
SYS_Timex_Adjust(&txc, 1);
|
if (SYS_Timex_Adjust(&txc, 1) < 0)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user