aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-06-22 01:04:27 -0700
committerGuy Harris <guy@alum.mit.edu>2018-06-22 08:05:10 +0000
commit23bef01ad30a8ef9726f156891f46e6196f6ea22 (patch)
treee03b952981a9e7238a56de5fddecbadbe662b5d3 /editcap.c
parent7728a336ed3b7684b08e66fa58d92325dfa1ee38 (diff)
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>
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/editcap.c b/editcap.c
index 1310e3e9d3..83ab463ba5 100644
--- a/editcap.c
+++ b/editcap.c
@@ -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;