diff options
author | 2008-06-28 21:51:12 +0000 | |
---|---|---|
committer | 2008-06-28 21:51:12 +0000 | |
commit | 6c957130955134cd8dbf70dd090dbe36de31e45b (patch) | |
tree | 8142a7c28cbd8ef23e19236744f2b12a26468a5c /src/lib | |
parent | 66360324c117dbb8b5e0893e9d1a0953d5651e21 (diff) |
Fixed assertion when compiled against MSVC and the string is UTF-8
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/util/astring.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c index 5c59b5e9fb8..20d12401d28 100644 --- a/src/lib/util/astring.c +++ b/src/lib/util/astring.c @@ -643,11 +643,11 @@ astring *astring_trimspace(astring *str) char *ptr; /* first remove stuff from the end */ - for (ptr = str->text + strlen(str->text) - 1; ptr >= str->text && isspace(*ptr); ptr--) + for (ptr = str->text + strlen(str->text) - 1; ptr >= str->text && (!(*ptr & 0x80) && isspace(*ptr)); ptr--) *ptr = 0; /* then count how much to remove from the beginning */ - for (ptr = str->text; *ptr != 0 && isspace(*ptr); ptr++) ; + for (ptr = str->text; *ptr != 0 && (!(*ptr & 0x80) && isspace(*ptr)); ptr++) ; if (ptr > str->text) astring_substr(str, ptr - str->text, -1); |