Squelch warning about an integer overflow
[gitweb.git] / pretty.c
index a181ac66875a158514bba48a21911adf9c5cd8be..9d34d02db11bd6761d48484327fbc6d1704ad555 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -964,9 +964,8 @@ static size_t parse_color(struct strbuf *sb, /* in UTF-8 */
                        if (!want_color(c->pretty_ctx->color))
                                return end - placeholder + 1;
                }
-               color_parse_mem(begin,
-                               end - begin,
-                               "--pretty format", color);
+               if (color_parse_mem(begin, end - begin, color) < 0)
+                       die(_("unable to parse --pretty format"));
                strbuf_addstr(sb, color);
                return end - placeholder + 1;
        }