diff options
Diffstat (limited to 'strings/strmake.c')
-rw-r--r-- | strings/strmake.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/strings/strmake.c b/strings/strmake.c index 05b5878d99c..2d5fa5e36aa 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -27,7 +27,7 @@ #include <my_global.h> #include "m_string.h" -char *strmake(register char *dst, register const char *src, uint length) +char *strmake(register char *dst, register const char *src, size_t length) { #ifdef EXTRA_DEBUG /* @@ -41,9 +41,9 @@ char *strmake(register char *dst, register const char *src, uint length) write a character rather than '\0' as this makes spotting these problems in the results easier. */ - uint n= strlen(src) + 1; - if (n <= length) - memset(dst + n, (int) 'Z', length - n + 1); + uint n= 0; + while (n < length && src[n++]); + memset(dst + n, (int) 'Z', length - n + 1); #endif while (length--) |