X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-log.c;h=911fd659906ebe87bf0adcd17519dd97777fb948;hb=e32c0a9c38a126c9eb8ff8f2fdc1fb8875400bbe;hp=f4975cf35f7f1555739f7657ee62ed983d18cb84;hpb=ac39efbdf3d41443c40166b7578b7fb87c2f3b60;p=git.git diff --git a/builtin-log.c b/builtin-log.c index f4975cf35..911fd6599 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -461,7 +461,7 @@ static int extra_cc_alloc; static void add_header(const char *value) { int len = strlen(value); - while (value[len - 1] == '\n') + while (len && value[len - 1] == '\n') len--; if (!strncasecmp(value, "to: ", 4)) { ALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);