diff options
author | sasha@mysql.sashanet.com <> | 2002-03-01 21:14:13 -0700 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2002-03-01 21:14:13 -0700 |
commit | b305a27ac1465f2dff7ff2d20813e46342e4521a (patch) | |
tree | 0e77b2158bac94d79228bc9817a0fc23422a0eea /mysys | |
parent | aa67831207689d9f4c2579508f8c0b9fd91135b7 (diff) | |
download | mariadb-git-b305a27ac1465f2dff7ff2d20813e46342e4521a.tar.gz |
post-merge fixup
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_vsnprintf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c index ccd4fbb74fc..7b6d9672eb6 100644 --- a/mysys/my_vsnprintf.c +++ b/mysys/my_vsnprintf.c @@ -19,6 +19,7 @@ #include <m_string.h> #include <stdarg.h> #include <m_ctype.h> +#include <assert.h> int my_snprintf(char* to, size_t n, const char* fmt, ...) { @@ -53,7 +54,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) plen = (uint) strlen(par); if (left_len <= plen) plen = left_len - 1; - to=strmov(to,par); + to=strnmov(to,par,plen); continue; } else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ @@ -73,6 +74,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) break; *to++='%'; /* % used as % or unknown code */ } + DBUG_ASSERT(to <= end); *to='\0'; /* End of errmessage */ return (uint) (to - start); } |