Skip to content

Commit

Permalink
Fix uninitialized variable in string_expand_length
Browse files Browse the repository at this point in the history
This led to totally unpredictable results from the function. The style
matches the loop in string_expand.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
  • Loading branch information
peff authored and jonas committed Feb 7, 2009
1 parent d270e1f commit 2677b74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2677b74

Please sign in to comment.