Commit b2dd5232 authored by Marko Mäkelä's avatar Marko Mäkelä

InnoDB: Remove ut_vsnprintf() and the use of my_vsnprintf(); use vsnprintf()

parent c19ef508
......@@ -2212,7 +2212,7 @@ buf_resize_status(
va_start(ap, fmt);
ut_vsnprintf(
vsnprintf(
export_vars.innodb_buffer_pool_resize_status,
sizeof(export_vars.innodb_buffer_pool_resize_status),
fmt, ap);
......
......@@ -119,7 +119,7 @@ buf_dump_status(
va_start(ap, fmt);
ut_vsnprintf(
vsnprintf(
export_vars.innodb_buffer_pool_dump_status,
sizeof(export_vars.innodb_buffer_pool_dump_status),
fmt, ap);
......@@ -158,7 +158,7 @@ buf_load_status(
va_start(ap, fmt);
ut_vsnprintf(
vsnprintf(
export_vars.innodb_buffer_pool_load_status,
sizeof(export_vars.innodb_buffer_pool_load_status),
fmt, ap);
......
......@@ -22494,7 +22494,7 @@ ib_errf(
if (vasprintf(&str, format, args) == -1) {
/* In case of failure use a fixed length string */
str = static_cast<char*>(malloc(BUFSIZ));
my_vsnprintf(str, BUFSIZ, format, args);
vsnprintf(str, BUFSIZ, format, args);
}
#else
/* Use a fixed length string. */
......@@ -22503,7 +22503,7 @@ ib_errf(
va_end(args);
return; /* Watch for Out-Of-Memory */
}
my_vsnprintf(str, BUFSIZ, format, args);
vsnprintf(str, BUFSIZ, format, args);
#endif /* _WIN32 */
ib_senderrf(thd, level, code, str);
......
......@@ -395,33 +395,6 @@ ut_copy_file(
FILE* dest, /*!< in: output file */
FILE* src); /*!< in: input file to be appended to output */
#ifdef _WIN32
/**********************************************************************//**
A substitute for vsnprintf(3), formatted output conversion into
a limited buffer. Note: this function DOES NOT return the number of
characters that would have been printed if the buffer was unlimited because
VC's _vsnprintf() returns -1 in this case and we would need to call
_vscprintf() in addition to estimate that but we would need another copy
of "ap" for that and VC does not provide va_copy(). */
void
ut_vsnprintf(
/*=========*/
char* str, /*!< out: string */
size_t size, /*!< in: str size */
const char* fmt, /*!< in: format */
va_list ap); /*!< in: format values */
#else
/**********************************************************************//**
A wrapper for vsnprintf(3), formatted output conversion into
a limited buffer. Note: this function DOES NOT return the number of
characters that would have been printed if the buffer was unlimited because
VC's _vsnprintf() returns -1 in this case and we would need to call
_vscprintf() in addition to estimate that but we would need another copy
of "ap" for that and VC does not provide va_copy(). */
# define ut_vsnprintf(buf, size, fmt, ap) \
((void) vsnprintf(buf, size, fmt, ap))
#endif /* _WIN32 */
/*************************************************************//**
Convert an error number to a human readable text message. The
returned string is static and should not be freed or modified.
......
......@@ -522,28 +522,6 @@ ut_copy_file(
} while (len > 0);
}
#ifdef _WIN32
# include <stdarg.h>
/**********************************************************************//**
A substitute for vsnprintf(3), formatted output conversion into
a limited buffer. Note: this function DOES NOT return the number of
characters that would have been printed if the buffer was unlimited because
VC's _vsnprintf() returns -1 in this case and we would need to call
_vscprintf() in addition to estimate that but we would need another copy
of "ap" for that and VC does not provide va_copy(). */
void
ut_vsnprintf(
/*=========*/
char* str, /*!< out: string */
size_t size, /*!< in: str size */
const char* fmt, /*!< in: format */
va_list ap) /*!< in: format values */
{
_vsnprintf(str, size, fmt, ap);
str[size - 1] = '\0';
}
#endif /* _WIN32 */
/** Convert an error number to a human readable text message.
The returned string is static and should not be freed or modified.
@param[in] num InnoDB internal error number
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment