summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authoracurtis/antony@xiphis.org/ltamd64.xiphis.org <>2008-02-19 13:46:54 -0800
committeracurtis/antony@xiphis.org/ltamd64.xiphis.org <>2008-02-19 13:46:54 -0800
commitd2ad8286a0e3abb63dd7789c9077b628467ff3e4 (patch)
treeb4c1b6b83eac45a53bc54569c2e3c89c88eb35b2 /strings
parentf6c3587eab462d9e211337690164f8e7fc4f307a (diff)
downloadmariadb-git-d2ad8286a0e3abb63dd7789c9077b628467ff3e4.tar.gz
backport valgrind cleanups from 6.0-engines
Diffstat (limited to 'strings')
-rw-r--r--strings/strmake.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/strings/strmake.c b/strings/strmake.c
index df8d78e8476..2d5fa5e36aa 100644
--- a/strings/strmake.c
+++ b/strings/strmake.c
@@ -41,9 +41,9 @@ char *strmake(register char *dst, register const char *src, size_t 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--)