From: blub Date: Fri, 25 Dec 2009 09:17:45 +0000 (+0000) Subject: fix u8_COM_StringLengthNoColors the same way other functions handle signedness X-Git-Tag: xonotic-v0.1.0preview~962 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=02d15ae94853a90661be3efc1c1c4496840885f1;p=xonotic%2Fdarkplaces.git fix u8_COM_StringLengthNoColors the same way other functions handle signedness git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9686 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/utf8lib.c b/utf8lib.c index b1749c12..6b2b985e 100644 --- a/utf8lib.c +++ b/utf8lib.c @@ -626,13 +626,14 @@ all characters until the zero terminator. size_t COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid); size_t -u8_COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid) +u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid) { - const char *end; + const unsigned char *s = (const unsigned char*)_s; + const unsigned char *end; size_t len = 0; if (!utf8_enable.integer) - return COM_StringLengthNoColors(s, size_s, valid); + return COM_StringLengthNoColors(_s, size_s, valid); end = size_s ? (s + size_s) : NULL;