all repos — cgit @ 7e67c64894b1093fbc009edd811fee1e76daa2d7

a hyperfast web frontend for git written in c

ui-ssdiff: fix decl-after-statement warnings

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>
John Keeping john@keeping.me.uk
Sun, 07 Aug 2016 16:14:49 +0100
commit

7e67c64894b1093fbc009edd811fee1e76daa2d7

parent

bead27b730526e4501ebaeb3b7c1116cd09f7b93

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M ui-ssdiff.cui-ssdiff.c

@@ -92,7 +92,7 @@

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 @@ len = buf2 - buf1;

buf2 = xmalloc(len + 1); strncpy(buf2, buf1, len); buf2[len] = '\0'; - int res = atoi(buf2); + res = atoi(buf2); free(buf2); return res; }