mirror of
https://gitea.quitesimple.org/crtxcr/cgitsb
synced 2024-11-23 04:22:07 +01:00
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>
This commit is contained in:
parent
bead27b730
commit
7e67c64894
@ -92,7 +92,7 @@ static char *longest_common_subsequence(char *A, char *B)
|
|||||||
static int line_from_hunk(char *line, char type)
|
static int line_from_hunk(char *line, char type)
|
||||||
{
|
{
|
||||||
char *buf1, *buf2;
|
char *buf1, *buf2;
|
||||||
int len;
|
int len, res;
|
||||||
|
|
||||||
buf1 = strchr(line, type);
|
buf1 = strchr(line, type);
|
||||||
if (buf1 == NULL)
|
if (buf1 == NULL)
|
||||||
@ -105,7 +105,7 @@ static int line_from_hunk(char *line, char type)
|
|||||||
buf2 = xmalloc(len + 1);
|
buf2 = xmalloc(len + 1);
|
||||||
strncpy(buf2, buf1, len);
|
strncpy(buf2, buf1, len);
|
||||||
buf2[len] = '\0';
|
buf2[len] = '\0';
|
||||||
int res = atoi(buf2);
|
res = atoi(buf2);
|
||||||
free(buf2);
|
free(buf2);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user