diff options
author | monty@donna.mysql.com <> | 2001-02-20 22:34:47 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2001-02-20 22:34:47 +0200 |
commit | 8e4968d9c727107dfd3621550d5cf2394d40bd57 (patch) | |
tree | f87e7ff2aa4e7016660a9275fe538c9ce99b6dfe /strings/strxnmov.c | |
parent | d25308e4dce3b0f40dbb04c9f26280139035c747 (diff) | |
download | mariadb-git-8e4968d9c727107dfd3621550d5cf2394d40bd57.tar.gz |
Added max_user_connections
Fixes for Innobase
Don't reset whole to-buffer in strxnmov
Diffstat (limited to 'strings/strxnmov.c')
-rw-r--r-- | strings/strxnmov.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/strings/strxnmov.c b/strings/strxnmov.c index 494b227209f..b55a2e0ab79 100644 --- a/strings/strxnmov.c +++ b/strings/strxnmov.c @@ -15,9 +15,9 @@ and NOT to use 0, as on some machines 0 is not the same size as a character pointer, or not the same bit pattern as NullS. - Note: strxnmov is like strnmov in that it always moves EXACTLY len - characters; dst will be padded on the right with NUL characters as - needed. strxncpy does the same. strxncat, like strncat, does NOT. + Note: strxnmov is like strnmov in that it moves up to len + characters; dst will be padded on the right with one NUL characters if + needed. */ #include <global.h> @@ -27,20 +27,22 @@ char *strxnmov(char *dst,uint len, const char *src, ...) { va_list pvar; - char *result; + char *end_of_dst=dst+len; va_start(pvar,src); - while (src != NullS) { - do if (len-- == 0) + while (src != NullS) + { + do { - va_end(pvar); - return dst; + if (dst == end_of_dst) + goto end; } - while ((*dst++ = *src++) != 0); + while ((*dst++ = *src++)); dst--; src = va_arg(pvar, char *); } - for (result= dst; len-- != 0; *dst++ = 0) ; + *dst=0; +end: va_end(pvar); - return result; + return dst; } |