The fractional part of a secs+nsecs time adjustment must be < 10^9.

One billion nanoseconds is 1 second, so that should just be expressed as
1 second.

Change-Id: I0d49838141fa877168d068a2e27b3dcc104c0cef
Reviewed-on: https://code.wireshark.org/review/28380
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-06-22 01:04:27 -07:00
parent 7728a336ed
commit 23bef01ad3
1 changed files with 3 additions and 3 deletions

View File

@ -382,7 +382,7 @@ set_time_adjustment(char *optarg_str_p)
val = strtol(&(frac[1]), &end, 10);
}
if (*frac != '.' || end == NULL || end == frac || val < 0
|| val > ONE_BILLION || val == LONG_MIN || val == LONG_MAX) {
|| val >= ONE_BILLION || val == LONG_MIN || val == LONG_MAX) {
fprintf(stderr, "editcap: \"%s\" isn't a valid time adjustment\n",
optarg_str_p);
return FALSE;
@ -456,7 +456,7 @@ set_strict_time_adj(char *optarg_str_p)
val = strtol(&(frac[1]), &end, 10);
}
if (*frac != '.' || end == NULL || end == frac || val < 0
|| val > ONE_BILLION || val == LONG_MIN || val == LONG_MAX) {
|| val >= ONE_BILLION || val == LONG_MIN || val == LONG_MAX) {
fprintf(stderr, "editcap: \"%s\" isn't a valid time adjustment\n",
optarg_str_p);
return FALSE;
@ -524,7 +524,7 @@ set_rel_time(char *optarg_str_p)
val = strtol(&(frac[1]), &end, 10);
}
if (*frac != '.' || end == NULL || end == frac || val < 0
|| val > ONE_BILLION || val == LONG_MIN || val == LONG_MAX) {
|| val >= ONE_BILLION || val == LONG_MIN || val == LONG_MAX) {
fprintf(stderr, "3: editcap: \"%s\" isn't a valid rel time value\n",
optarg_str_p);
return FALSE;