]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
do not use non-standard strnlen function
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Dec 2009 10:51:55 +0000 (10:51 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Dec 2009 10:51:55 +0000 (10:51 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9643 d7cf8633-e32d-0410-b094-e92efae38249

common.c

index 70f36e717067dec6a1b40427f4b52f2fbd316026..dcec77eb391d824d905e52da00c72d09af94454c 100644 (file)
--- a/common.c
+++ b/common.c
@@ -740,7 +740,9 @@ int COM_Wordwrap(const char *string, size_t length, float continuationWidth, flo
                                        }
                                }
                                out_inner:
-                               wordChars = strnlen(cursor, wordLen);
+                               wordChars = strlen(cursor);
+                               if (wordChars > wordLen)
+                                       wordChars = wordLen;
                                spaceUsedForWord = wordWidth(passthroughCW, cursor, &wordChars, maxWidth - continuationWidth); // this may have reduced wordLen when it won't fit - but this is GOOD. TODO fix words that do fit in a non-continuation line
                                if(wordChars < 1)
                                {