]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Fewer uses of size_t in suffix.c
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 06:47:23 +0000 (23:47 -0700)
* src/suffix.c (struct compression_suffix)
(find_compression_suffix, set_compression_program_by_suffix)
(strip_compression_suffix): Prefer idx_t to size_t.

src/suffix.c

index 0d1f34ee7e4eb96e29336f072eed40fd5c9774e9..6f3201dec564006b680d535d035aef0dd84fde3d 100644 (file)
@@ -22,7 +22,7 @@
 struct compression_suffix
 {
   const char *suffix;
-  size_t length;
+  idx_t length;
   const char *program;
 };
 
@@ -60,13 +60,13 @@ static struct compression_suffix compression_suffixes[] = {
    there the length of NAME with that suffix stripped, or 0 if NAME has
    no suffix. */
 static struct compression_suffix const *
-find_compression_suffix (const char *name, size_t *ret_len)
+find_compression_suffix (const char *name, idx_t *ret_len)
 {
   char *suf = strrchr (name, '.');
 
   if (suf && suf[1] != 0 && suf[1] != '/')
     {
-      size_t len;
+      idx_t len;
       struct compression_suffix *p;
 
       suf++;
@@ -95,7 +95,7 @@ void
 set_compression_program_by_suffix (const char *name, const char *defprog,
                                   bool verbose)
 {
-  size_t len;
+  idx_t len;
   struct compression_suffix const *p = find_compression_suffix (name, &len);
   if (p)
     use_compress_program_option = p->program;
@@ -115,7 +115,7 @@ char *
 strip_compression_suffix (const char *name)
 {
   char *s = NULL;
-  size_t len;
+  idx_t len;
   struct compression_suffix const *p = find_compression_suffix (name, &len);
 
   if (p)