Skip to content

Commit cc10837

Browse files
felipecgitster
authored andcommitted
alias: have SP around arithmetic operators
Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c01499e commit cc10837

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

alias.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ static char *alias_val;
55

66
static int alias_lookup_cb(const char *k, const char *v, void *cb)
77
{
8-
if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
8+
if (!prefixcmp(k, "alias.") && !strcmp(k + 6, alias_key)) {
99
if (!v)
1010
return config_error_nonbool(k);
1111
alias_val = xstrdup(v);
@@ -34,7 +34,7 @@ int split_cmdline(char *cmdline, const char ***argv)
3434
int src, dst, count = 0, size = 16;
3535
char quoted = 0;
3636

37-
*argv = xmalloc(sizeof(char *) * size);
37+
*argv = xmalloc(sizeof(**argv) * size);
3838

3939
/* split alias_string */
4040
(*argv)[count++] = cmdline;
@@ -45,7 +45,7 @@ int split_cmdline(char *cmdline, const char ***argv)
4545
while (cmdline[++src]
4646
&& isspace(cmdline[src]))
4747
; /* skip */
48-
ALLOC_GROW(*argv, count+1, size);
48+
ALLOC_GROW(*argv, count + 1, size);
4949
(*argv)[count++] = cmdline + dst;
5050
} else if (!quoted && (c == '\'' || c == '"')) {
5151
quoted = c;
@@ -76,12 +76,13 @@ int split_cmdline(char *cmdline, const char ***argv)
7676
return -SPLIT_CMDLINE_UNCLOSED_QUOTE;
7777
}
7878

79-
ALLOC_GROW(*argv, count+1, size);
79+
ALLOC_GROW(*argv, count + 1, size);
8080
(*argv)[count] = NULL;
8181

8282
return count;
8383
}
8484

85-
const char *split_cmdline_strerror(int split_cmdline_errno) {
86-
return split_cmdline_errors[-split_cmdline_errno-1];
85+
const char *split_cmdline_strerror(int split_cmdline_errno)
86+
{
87+
return split_cmdline_errors[-split_cmdline_errno - 1];
8788
}

0 commit comments

Comments
 (0)