From 76ccf2403a0a3784c9a71bf0dd79c07c9f627112 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Jul 2013 09:10:51 +0000 Subject: correct placement of debug memset() for DEBUG_STRSIZE --- source/blender/blenlib/intern/string_utf8.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index a0ab16e24d6..8bc3f6497c3 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -209,15 +209,15 @@ char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t char *BLI_strncat_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) { -#ifdef DEBUG_STRSIZE - memset(dst, 0xff, sizeof(*dst) * maxncpy); -#endif - while (*dst && maxncpy > 0) { dst++; maxncpy--; } +#ifdef DEBUG_STRSIZE + memset(dst, 0xff, sizeof(*dst) * maxncpy); +#endif + BLI_STR_UTF8_CPY(dst, src, maxncpy); return dst; -- cgit v1.2.3