]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Remove cast from from_header
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Aug 2024 06:26:41 +0000 (23:26 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 15 Aug 2024 06:25:46 +0000 (23:25 -0700)
* src/list.c (from_header): Reword to avoid a cast
to unsigned char.

src/list.c

index 49e8e987b726051a192be65d4070e8baf08d0456..04005092e909aecf128f2cb4b8be923641eefded 100644 (file)
@@ -830,7 +830,6 @@ from_header (char const *where0, size_t digs, char const *type,
       /* Parse base-64 output produced only by tar test versions
         1.13.6 (1999-08-11) through 1.13.11 (1999-08-23).
         Support for this will be withdrawn in future releases.  */
-      int dig;
       if (!silent)
        {
          static bool warned_once;
@@ -841,9 +840,12 @@ from_header (char const *where0, size_t digs, char const *type,
            }
        }
       negative = *where++ == '-';
-      while (where != lim
-            && (dig = base64_map[(unsigned char) *where]) < 64)
+      while (where != lim)
        {
+         unsigned char uc = *where;
+         int dig = base64_map[uc];
+         if (64 <= dig)
+           break;
          if (ckd_mul (&value, value, 64))
            {
              if (type && !silent)