summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authoristruewing@stella.local <>2008-03-26 10:27:00 +0100
committeristruewing@stella.local <>2008-03-26 10:27:00 +0100
commit44fbe74e1e7c6055f10f5eb7ab6f467e0c4aa966 (patch)
tree69df040c98a9edd26de9be04066dff14eb50319e /strings
parentbc683c6450a40a148e3cb321de26c35fca5749b6 (diff)
parent97531cadc9fb1df270b435cc15a19b7f9b0195a8 (diff)
downloadmariadb-git-44fbe74e1e7c6055f10f5eb7ab6f467e0c4aa966.tar.gz
Merge stella.local:/home2/mydev/mysql-5.1-amain
into stella.local:/home2/mydev/mysql-5.1-axmrg
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--)