From e86d9d2f088b3ec10cb0ffee10135017844e71f7 Mon Sep 17 00:00:00 2001 From: blub Date: Wed, 23 Dec 2009 10:51:55 +0000 Subject: [PATCH] do not use non-standard strnlen function git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9643 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.c b/common.c index 70f36e71..dcec77eb 100644 --- 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) { -- 2.39.2