diff options
author | Andrey Hristov <andrey@php.net> | 2011-03-18 14:56:20 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2011-03-18 14:56:20 +0000 |
commit | f06443593eb832dd1c796c787f079f9aeb3fe691 (patch) | |
tree | 82099e891e7d610625e3435a72cf15be15e09fa3 /ext/mysqlnd/mysqlnd_debug.c | |
parent | c90df5850b6540e5b14e7db81bbe64880b5c98a6 (diff) | |
download | php-git-f06443593eb832dd1c796c787f079f9aeb3fe691.tar.gz |
add a proxy for sppintf and vspprintf
Diffstat (limited to 'ext/mysqlnd/mysqlnd_debug.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_debug.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index 7d2da7e03e..4c8f1ebce0 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -129,7 +129,7 @@ MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self, level_buffer[sizeof(level_buffer) - 1 ] = '\0'; } - message_line_len = spprintf(&message_line, 0, "%s%s%s%s%s%s%s%s\n", + message_line_len = mnd_sprintf(&message_line, 0, "%s%s%s%s%s%s%s%s\n", flags & MYSQLND_DEBUG_DUMP_PID? pid_buffer:"", flags & MYSQLND_DEBUG_DUMP_TIME? time_buffer:"", flags & MYSQLND_DEBUG_DUMP_FILE? file_buffer:"", @@ -138,7 +138,7 @@ MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self, pipe_buffer, type? type:"", message); ret = php_stream_write(self->stream, message_line, message_line_len)? PASS:FAIL; - efree(message_line); /* allocated by spprintf */ + mnd_sprintf_free(message_line); if (flags & MYSQLND_DEBUG_FLUSH) { self->m->close(self); self->m->open(self, TRUE); @@ -227,21 +227,20 @@ MYSQLND_METHOD(mysqlnd_debug, log_va)(MYSQLND_DEBUG *self, level_buffer[sizeof(level_buffer) - 1 ] = '\0'; } - va_start(args, format); - vspprintf(&buffer, 0, format, args); + mnd_vsprintf(&buffer, 0, format, args); va_end(args); - message_line_len = spprintf(&message_line, 0, "%s%s%s%s%s%s%s%s\n", + message_line_len = mnd_sprintf(&message_line, 0, "%s%s%s%s%s%s%s%s\n", flags & MYSQLND_DEBUG_DUMP_PID? pid_buffer:"", flags & MYSQLND_DEBUG_DUMP_TIME? time_buffer:"", flags & MYSQLND_DEBUG_DUMP_FILE? file_buffer:"", flags & MYSQLND_DEBUG_DUMP_LINE? line_buffer:"", flags & MYSQLND_DEBUG_DUMP_LEVEL? level_buffer:"", pipe_buffer, type? type:"", buffer); - efree(buffer); + mnd_sprintf_free(buffer); ret = php_stream_write(self->stream, message_line, message_line_len)? PASS:FAIL; - efree(message_line); /* allocated by spprintf */ + mnd_sprintf_free(message_line); if (flags & MYSQLND_DEBUG_FLUSH) { self->m->close(self); |