summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <acurtis/antony@xiphis.org/ltamd64.xiphis.org>2008-02-19 13:46:54 -0800
committerunknown <acurtis/antony@xiphis.org/ltamd64.xiphis.org>2008-02-19 13:46:54 -0800
commit40089da1db09fc58aa1c696809e91cf471d30948 (patch)
treeb4c1b6b83eac45a53bc54569c2e3c89c88eb35b2 /strings
parent53fe1435e65e19267a712c88f3027f65a942aeee (diff)
downloadmariadb-git-40089da1db09fc58aa1c696809e91cf471d30948.tar.gz
backport valgrind cleanups from 6.0-engines
mysql-test/valgrind.supp: silence valgrind warning of memory leak in dlopen strings/strmake.c: silence valgrind warning cause by strlen examining unset bytes.
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--)