From 2677b744313c939890a8f6b3316f9d5452581ab8 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 7 Feb 2009 05:37:23 -0500 Subject: [PATCH] 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 --- tig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.32.0.93.g670b81a890