cleanup
This commit is contained in:
parent
75d42255f2
commit
6af1b812ae
12
util.c
12
util.c
@ -56,11 +56,11 @@ eat(char *s, int (*p)(int), int r) {
|
|||||||
|
|
||||||
static char*
|
static char*
|
||||||
skip(char *s, char c) {
|
skip(char *s, char c) {
|
||||||
while(*s != c && *s != '\0')
|
while(*s != c && *s != '\0')
|
||||||
s++;
|
s++;
|
||||||
if (*s != '\0')
|
if(*s != '\0')
|
||||||
*s++ = '\0';
|
*s++ = '\0';
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -68,7 +68,7 @@ trim(char *s) {
|
|||||||
char *e;
|
char *e;
|
||||||
|
|
||||||
e = s + strlen(s) - 1;
|
e = s + strlen(s) - 1;
|
||||||
while (isspace(*e) && e > s)
|
while(isspace(*e) && e > s)
|
||||||
e--;
|
e--;
|
||||||
*(e + 1) = '\0';
|
*(e + 1) = '\0';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user