]> git.ipfire.org Git - thirdparty/tar.git/commit
Avoid strtoul
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Aug 2024 00:03:22 +0000 (17:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 15 Aug 2024 06:25:45 +0000 (23:25 -0700)
commit4642cd04edbd57414e004920fa4976d9f3be6206
tree3a1515c6f1bc3c6f327723368b8b047bc6ce6d7c
parenta80f364662cbe6bb213962d57419230673bdcb55
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.
gnulib.modules
src/checkpoint.c
src/common.h
src/system.c
src/tar.c
src/tar.h
src/transform.c
src/xheader.c