mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-09-20 23:24:13 +00:00
Avoid strtoul
This is part of the general trend to prefer signed integer types, to allow better runtime checking with -fsanitize=undefined etc. * gnulib.modules: Remove strtoul. Add xstrtoimax. * src/checkpoint.c (checkpoint, format_checkpoint_string): * src/system.c (sys_exec_checkpoint_script): * src/tar.c (checkpoint_option): Use intmax_t, not unsigned, for checkpoint numbers. All uses changed. * src/checkpoint.c (checkpoint_compile_action): Don’t assume time_t == unsigned long. Treat overflows as TYPE_MAXIMUM (time_t), essentially infinity. * src/tar.c (tar_sparse_major, tar_sparse_minor): * src/tar.h (struct tar_stat_info): Use intmax_t, not unsigned, for sparse major and minor. All uses changed. * src/tar.c (parse_opt): Don’t mishandle multiple specifications of sparse major and minor. * src/transform.c (struct transform): Use idx_t, not unsigned, for match_number. All uses changed. (parse_transform_expr): Don’t mishandle large match numbers by wrapping them around.
This commit is contained in:
+1
-1
@@ -108,7 +108,6 @@ strerror
|
||||
strnlen
|
||||
strtoimax
|
||||
strtol
|
||||
strtoul
|
||||
strtoumax
|
||||
symlinkat
|
||||
sys_stat
|
||||
@@ -123,6 +122,7 @@ xalignalloc
|
||||
xalloc
|
||||
xalloc-die
|
||||
xgetcwd
|
||||
xstrtoimax
|
||||
xstrtoumax
|
||||
xvasprintf
|
||||
year2038-recommended
|
||||
|
||||
Reference in New Issue
Block a user