We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 392b397 commit da14019Copy full SHA for da14019
1 file changed
arg_parse.c
@@ -13,7 +13,7 @@ int get_argc(char *s)
13
sp++;
14
if (*sp == '\0')
15
return count;
16
- else
+ else
17
count++;
18
while (!isspace(*sp) && *sp != '\0')
19
@@ -33,7 +33,7 @@ char **get_args(char *s, int index)
33
{
34
char **args, arg[BUFSIZE], *argp;
35
int i;
36
- args = (char **) malloc (BUFSIZ);
+ args = (char **) malloc (BUFSIZE);
37
38
s += index;
39
_argc = get_argc(s);
@@ -48,7 +48,7 @@ char **get_args(char *s, int index)
48
_argc--;
49
goto top;
50
}
51
- while (!isspace(*s) || *s == '\0')
+ while (!isspace(*s) && *s != '\0')
52
*argp++ = *s++;
53
54
*argp = '\0';
0 commit comments