summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorcmiller@zippy.(none) <>2006-05-01 22:50:36 -0400
committercmiller@zippy.(none) <>2006-05-01 22:50:36 -0400
commit1205ae82769be49e7c20aecf9277673eeca0a145 (patch)
treeaae6cd99ec61e48a42db408ac62d15a8261284d3 /strings
parent715833dbb7c0b49a49dd34a8d8b217f255e1cf0b (diff)
parent85ffd9640eb5bb9e4f00857090a3f854ade78694 (diff)
downloadmariadb-git-1205ae82769be49e7c20aecf9277673eeca0a145.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.(none):/home/cmiller/work/mysql/mysql-5.0__bug17667
Diffstat (limited to 'strings')
-rw-r--r--strings/my_vsnprintf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 0e036c2bbcd..d917e9e11b2 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -27,6 +27,7 @@
%#[l]d
%#[l]u
%#[l]x
+ %#.#b Local format; note first # is ignored and second is REQUIRED
%#.#s Note first # is ignored
RETURN
@@ -40,7 +41,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
for (; *fmt ; fmt++)
{
- if (fmt[0] != '%')
+ if (*fmt != '%')
{
if (to == end) /* End of buffer */
break;
@@ -95,6 +96,12 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
to=strnmov(to,par,plen);
continue;
}
+ else if (*fmt == 'b') /* Buffer parameter */
+ {
+ char *par = va_arg(ap, char *);
+ to=memmove(to, par, abs(width));
+ continue;
+ }
else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */
{
register long larg;