mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 15:36:29 +01:00
fixup! stringop.c: rewrite strip_whitespace
This commit is contained in:
parent
bd35879e1c
commit
5bef06adfd
1 changed files with 4 additions and 4 deletions
|
@ -16,10 +16,10 @@ void strip_whitespace(char *str) {
|
|||
size_t start = strspn(str, whitespace);
|
||||
memmove(str, &str[start], len + 1 - start);
|
||||
|
||||
if (!*str) return;
|
||||
|
||||
for (len -= start + 1; isspace(str[len]); --len) {}
|
||||
str[len + 1] = '\0';
|
||||
if (*str) {
|
||||
for (len -= start + 1; isspace(str[len]); --len) {}
|
||||
str[len + 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void strip_quotes(char *str) {
|
||||
|
|
Loading…
Reference in a new issue