]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Pacify clang char conversion
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 28 Feb 2021 21:42:49 +0000 (13:42 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Mar 2021 08:18:44 +0000 (00:18 -0800)
* src/create.c (to_chars): Pacify ‘clang’ about assigning
128 to ‘char’.

src/create.c

index 6c99c74dc1180cafe4a8440e31ce4b3748cb5b94..7ca742f5cb15ba856ae07041acabcc128d4e6e0c 100644 (file)
@@ -308,7 +308,7 @@ to_chars (int negative, uintmax_t value, size_t valsize,
       if (((negative ? -1 - value : value)
           <= MAX_VAL_WITH_DIGITS (size - 1, LG_256)))
        {
-         where[0] = negative ? -1 : 1 << (LG_256 - 1);
+         where[0] = (char) (negative ? -1 : 1 << (LG_256 - 1));
          to_base256 (negative, value, where + 1, size - 1);
          return true;
        }