]> git.ipfire.org Git - thirdparty/git.git/blobdiff - pretty.c
pretty: fix integer overflow in wrapping format
[thirdparty/git.git] / pretty.c
index c6c757c0cead5729eea06be169af9d3d09b6bfd3..7e649b1cec71cd5b32afe837c5ea96602a66f50b 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -915,7 +915,9 @@ static void strbuf_wrap(struct strbuf *sb, size_t pos,
        if (pos)
                strbuf_add(&tmp, sb->buf, pos);
        strbuf_add_wrapped_text(&tmp, sb->buf + pos,
-                               (int) indent1, (int) indent2, (int) width);
+                               cast_size_t_to_int(indent1),
+                               cast_size_t_to_int(indent2),
+                               cast_size_t_to_int(width));
        strbuf_swap(&tmp, sb);
        strbuf_release(&tmp);
 }