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

Signed-off-by: Julius Plenz <[email protected]>
---
 ui-ssdiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui-ssdiff.c b/ui-ssdiff.c
index 7108779..fbb46cf 100644
--- a/ui-ssdiff.c
+++ b/ui-ssdiff.c
@@ -138,9 +138,9 @@ static char *replace_tabs(char *line)
                        strcat(result, prev_buf);
                        break;
                } else {
+                       strncat(result, prev_buf, cur_buf - prev_buf);
                        strcat(result, " ");
                        strncat(result, spaces, 8 - (strlen(result) % 8));
-                       strncat(result, prev_buf, cur_buf - prev_buf);
                }
                prev_buf = cur_buf + 1;
        }
-- 
1.7.12.3-zedat


_______________________________________________
cgit mailing list
[email protected]
http://hjemli.net/mailman/listinfo/cgit

Reply via email to