mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Fixed assertion when compiled against MSVC and the string is UTF-8
This commit is contained in:
parent
66360324c1
commit
6c95713095
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user