summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.(none)>2006-05-01 22:50:36 -0400
committerunknown <cmiller@zippy.(none)>2006-05-01 22:50:36 -0400
commit4d1cd02ef6fb976b12b0ee9542f49ababc81abeb (patch)
treeaae6cd99ec61e48a42db408ac62d15a8261284d3 /strings
parent71c4827b8117f6626371a6389bc91496605ebf3c (diff)
parent3010890e589de89d2f5bb4c0e2c3a0b06b827b10 (diff)
downloadmariadb-git-4d1cd02ef6fb976b12b0ee9542f49ababc81abeb.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.(none):/home/cmiller/work/mysql/mysql-5.0__bug17667 mysys/Makefile.am: Auto merged sql/sql_parse.cc: Auto merged
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;