]> granicus.if.org Git - xz/commitdiff
tuklib_mbstr_width: Fix a warning from -Wsign-conversion.
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 23 Jun 2019 20:22:45 +0000 (23:22 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 23 Jun 2019 20:22:45 +0000 (23:22 +0300)
src/common/tuklib_mbstr_width.c

index 3c38990f460827fc08b479c7fc84c7de7ec1ff95..4bbe964793ccee2857b88e35bf35edad5f0a85ab 100644 (file)
@@ -50,7 +50,7 @@ tuklib_mbstr_width(const char *str, size_t *bytes)
                if (wc_width < 0)
                        return (size_t)-1;
 
-               width += wc_width;
+               width += (size_t)wc_width;
        }
 
        // Require that the string ends in the initial shift state.