diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-10 14:02:16 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-12 20:41:34 +0200 |
commit | 58c9982e75c1b23b9c3ff9aad8295035866a67f0 (patch) | |
tree | 509e2313ac5204d54d29863c7fa4d9c9253684a7 /lib/common/test/fstree_cli.c | |
parent | aafae427048afa25e71d31deeae79b7b7f767891 (diff) |
Win32: Fix fstree CLI mtime range check
On Windows, long is a 32 bit integer, so we cannot check if the long
value is greater than UINT32_MAX. Instead, check if strtol sets errno.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/common/test/fstree_cli.c')
-rw-r--r-- | lib/common/test/fstree_cli.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/common/test/fstree_cli.c b/lib/common/test/fstree_cli.c index a582adb..fc63a98 100644 --- a/lib/common/test/fstree_cli.c +++ b/lib/common/test/fstree_cli.c @@ -43,5 +43,15 @@ int main(int argc, char **argv) TEST_ASSERT(parse_fstree_defaults(&fs, str) != 0); free(str); + str = strdup("mtime=-12"); + TEST_NOT_NULL(str); + TEST_ASSERT(parse_fstree_defaults(&fs, str) != 0); + free(str); + + str = strdup("mtime=4294967296"); + TEST_NOT_NULL(str); + TEST_ASSERT(parse_fstree_defaults(&fs, str) != 0); + free(str); + return EXIT_SUCCESS; } |