Fix some uses of int in list.c

* src/list.c (decode_xform): Last arg is now int, not a void *
pointer to that int.  All uses changed.
(enforce_one_top_level): Don’t assume string length fits in int.
(transform_stat_info): Prefer char to int for typeflag.
All uses changed.
(decode_header): Prefer bool for booleans.  All uses changed.
(ugswidth): Now idx_t, not int, since in theory it could
exceed INT_MAX.  All uses changed.
(simple_print_header, print_for_mkdir): Don’t assume printf length
fits in int, and similarly for length of user or group name.
* src/transform.c (transform_name_fp): Last arg is now int, not void *.
All uses changed.
This commit is contained in:
Paul Eggert
2024-11-01 18:45:00 -07:00
parent 7eb4dbaff1
commit 91ad4ea343
5 changed files with 66 additions and 80 deletions

View File

@@ -589,7 +589,7 @@ _transform_name_to_obstack (int flags, char *input, char **output)
bool
transform_name_fp (char **pinput, int flags,
char *(*fun)(char *, void *), void *dat)
char *(*fun) (char *, int), int dat)
{
char *str;
bool ret = _transform_name_to_obstack (flags, *pinput, &str);
@@ -611,7 +611,7 @@ transform_name_fp (char **pinput, int flags,
bool
transform_name (char **pinput, int type)
{
return transform_name_fp (pinput, type, NULL, NULL);
return transform_name_fp (pinput, type, NULL, 0);
}
bool