]> granicus.if.org Git - cgit/commitdiff
ui-ssdiff: fix decl-after-statement warnings
authorJohn Keeping <john@keeping.me.uk>
Sun, 7 Aug 2016 15:14:49 +0000 (16:14 +0100)
committerJohn Keeping <john@keeping.me.uk>
Sat, 1 Oct 2016 10:43:45 +0000 (11:43 +0100)
git.git's coding style avoids decl-after-statement and we generally try
to follow it but a few warnings have crept in recently.  Fix the one in
ui-ssdiff.c

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-ssdiff.c

index 16c812ffdc74143434e8925adb37b3d949d93fb9..7f261ed53a0077fa3fd4a8dab3db1fcdcf247a8c 100644 (file)
@@ -92,7 +92,7 @@ static char *longest_common_subsequence(char *A, char *B)
 static int line_from_hunk(char *line, char type)
 {
        char *buf1, *buf2;
-       int len;
+       int len, res;
 
        buf1 = strchr(line, type);
        if (buf1 == NULL)
@@ -105,7 +105,7 @@ static int line_from_hunk(char *line, char type)
        buf2 = xmalloc(len + 1);
        strncpy(buf2, buf1, len);
        buf2[len] = '\0';
-       int res = atoi(buf2);
+       res = atoi(buf2);
        free(buf2);
        return res;
 }