fixup! stringop.c: rewrite strip_whitespace

master
Ian Fan 6 years ago
parent bd35879e1c
commit 5bef06adfd

@ -16,11 +16,11 @@ void strip_whitespace(char *str) {
size_t start = strspn(str, whitespace);
memmove(str, &str[start], len + 1 - start);
if (!*str) return;
if (*str) {
for (len -= start + 1; isspace(str[len]); --len) {}
str[len + 1] = '\0';
}
}
void strip_quotes(char *str) {
bool in_str = false;

Loading…
Cancel
Save