From: Jeff King Date: Sat, 7 Feb 2009 10:37:23 +0000 (-0500) Subject: Fix uninitialized variable in string_expand_length X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2677b744313c939890a8f6b3316f9d5452581ab8;p=tig.git Fix uninitialized variable in string_expand_length This led to totally unpredictable results from the function. The style matches the loop in string_expand. Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca --- diff --git a/tig.c b/tig.c index 79afdb1..97794b0 100644 --- a/tig.c +++ b/tig.c @@ -193,7 +193,7 @@ string_expand_length(const char *line, int tabsize) { size_t size, pos; - for (pos = 0; line[pos]; pos++) { + for (size = pos = 0; line[pos]; pos++) { if (line[pos] == '\t' && tabsize > 0) size += tabsize - (size % tabsize); else