diff options
author | Michael Widenius <monty@askmonty.org> | 2013-06-28 01:53:41 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2013-06-28 01:53:41 +0300 |
commit | ecf9b1b754a2d67137f0b16661309d021560ad2d (patch) | |
tree | d6da9cce825a146ef8432d38fb9dc0d5b81b9a2a /strings/my_vsnprintf.c | |
parent | 70092601bc3fa0fbae06b12c1e77b81d05bc3224 (diff) | |
download | mariadb-git-ecf9b1b754a2d67137f0b16661309d021560ad2d.tar.gz |
Fixed some wrong format strings.
Fixed OPTIMIZE with innodb
include/my_sys.h:
Removed ATTRIBUTE_FORMAT() as it gave warnings for %'s
sql/log_event.cc:
Optimization:
use my_b_write() and my_b_write_byte() instead of my_b_printf()
use strmake() instead of my_snprintf()
sql/sql_admin.cc:
Fixed bug in admin_recreate_table()
Fixed OPTIMIZE with innodb
sql/sql_table.cc:
Indentation fixes
strings/my_vsnprintf.c:
Changed fprintf() to fputs()
Diffstat (limited to 'strings/my_vsnprintf.c')
-rw-r--r-- | strings/my_vsnprintf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index a05f60decf9..1584a9e2cef 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -735,7 +735,7 @@ int my_vfprintf(FILE *stream, const char* format, va_list args) char cvtbuf[1024]; int alloc= 0; char *p= cvtbuf; - size_t cur_len= sizeof(cvtbuf); + size_t cur_len= sizeof(cvtbuf), actual; int ret; /* @@ -746,7 +746,7 @@ int my_vfprintf(FILE *stream, const char* format, va_list args) for (;;) { size_t new_len; - size_t actual= my_vsnprintf(p, cur_len, format, args); + actual= my_vsnprintf(p, cur_len, format, args); if (actual < cur_len - 1) break; /* @@ -766,7 +766,9 @@ int my_vfprintf(FILE *stream, const char* format, va_list args) if (!p) return 0; } - ret= fprintf(stream, "%s", p); + ret= (int) actual; + if (fputs(p, stream) < 0) + ret= -1; if (alloc) (*my_str_free)(p); return ret; |