]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff.c
Upcast size_t variables to uintmax_t when printing
[thirdparty/git.git] / diff.c
diff --git a/diff.c b/diff.c
index e82b6341ee539882a7f0a21322ab304070a47a23..88aaed7d49010e38fcf3f3fee726c18de99ddb36 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3227,7 +3227,7 @@ static void emit_binary_diff_body(struct diff_options *o,
        }
 
        if (delta && delta_size < deflate_size) {
-               char *s = xstrfmt("%lu", orig_size);
+               char *s = xstrfmt("%"PRIuMAX , (uintmax_t)orig_size);
                emit_diff_symbol(o, DIFF_SYMBOL_BINARY_DIFF_HEADER_DELTA,
                                 s, strlen(s), 0);
                free(s);
@@ -4302,12 +4302,12 @@ static void diff_fill_oid_info(struct diff_filespec *one, struct index_state *is
 static void strip_prefix(int prefix_length, const char **namep, const char **otherp)
 {
        /* Strip the prefix but do not molest /dev/null and absolute paths */
-       if (*namep && **namep != '/') {
+       if (*namep && !is_absolute_path(*namep)) {
                *namep += prefix_length;
                if (**namep == '/')
                        ++*namep;
        }
-       if (*otherp && **otherp != '/') {
+       if (*otherp && !is_absolute_path(*otherp)) {
                *otherp += prefix_length;
                if (**otherp == '/')
                        ++*otherp;