ssdiff: correctly manage tab expansion

Previously, replace_tabs("foo\tbar") would become "        foobar".

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Julius Plenz 2012-11-15 17:35:06 +01:00 committed by Jason A. Donenfeld
parent b1e172acca
commit 225c8aba31
1 changed files with 1 additions and 2 deletions

View File

@ -138,9 +138,8 @@ static char *replace_tabs(char *line)
strcat(result, prev_buf);
break;
} else {
strcat(result, " ");
strncat(result, spaces, 8 - (strlen(result) % 8));
strncat(result, prev_buf, cur_buf - prev_buf);
strncat(result, spaces, 8 - (strlen(result) % 8));
}
prev_buf = cur_buf + 1;
}