1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-02 14:35:47 +01:00

Fixed wtrimspace() whih had wrong behavior.

This commit is contained in:
dan
2000-10-25 22:41:03 +00:00
parent e215328d81
commit 99ce8b2d85

View File

@@ -164,12 +164,12 @@ wtrimspace(char *s)
char *c; char *c;
while (isspace(*s) && *s) s++; while (isspace(*s) && *s) s++;
t = s+strlen(s); t = s+strlen(s)-1;
while (t > s && isspace(*t)) t--; while (t > s && isspace(*t)) t--;
c = wmalloc(t-s + 1); c = wmalloc(t-s+2);
memcpy(c, s, t-s); memcpy(c, s, t-s+1);
c[t-s] = 0; c[t-s+1] = 0;
return c; return c;
} }