aboutsummaryrefslogtreecommitdiff
path: root/mysql/libmysql/authentication_win/common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mysql/libmysql/authentication_win/common.cpp')
-rw-r--r--mysql/libmysql/authentication_win/common.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/mysql/libmysql/authentication_win/common.cpp b/mysql/libmysql/authentication_win/common.cpp
index 48c400d..aa8f7ee 100644
--- a/mysql/libmysql/authentication_win/common.cpp
+++ b/mysql/libmysql/authentication_win/common.cpp
@@ -31,8 +31,8 @@ template <> void error_log_print<error_log_level::ERROR>(const char *fmt, ...);
3 - additionally log info notes
4 - also log debug messages
- Value of this option should be taken into account in the
- implementation of error_log_vprint() function (see
+ Value of this option should be taken into account in the
+ implementation of error_log_vprint() function (see
log_client.cc).
Note: No error or debug messages are logged in production code
@@ -365,17 +365,17 @@ UPN::~UPN()
@return Pointer to a buffer containing utf8 representation or NULL in
case of error.
- @note The returned buffer must be freed with @c free() call.
+ @note The returned buffer must be freed with @c free() call.
*/
char* wchar_to_utf8(const wchar_t *string, size_t *len)
{
- char *buf= NULL;
+ char *buf= NULL;
size_t str_len= len && *len ? *len : wcslen(string);
/*
A conversion from utf8 to wchar_t will never take more than 3 bytes per
- character, so a buffer of length 3 * str_len schould be sufficient.
+ character, so a buffer of length 3 * str_len schould be sufficient.
We check that assumption with an assertion later.
*/
@@ -410,7 +410,7 @@ char* wchar_to_utf8(const wchar_t *string, size_t *len)
Error_message_buf error_buf;
DBUG_PRINT("error", ("Could not convert string '%S' to utf8"
", WideCharToMultiByte() failed with error %X (%s)",
- string, GetLastError(),
+ string, GetLastError(),
get_last_error_message(error_buf)));
#endif
@@ -433,14 +433,14 @@ char* wchar_to_utf8(const wchar_t *string, size_t *len)
@return Pointer to a buffer containing wide-char representation or NULL in
case of error.
- @note The returned buffer must be freed with @c free() call.
+ @note The returned buffer must be freed with @c free() call.
*/
wchar_t* utf8_to_wchar(const char *string, size_t *len)
{
size_t buf_len;
- /*
+ /*
Note: length (in bytes) of an utf8 string is always bigger than the
number of characters in this string. Hence a buffer of size len will
be sufficient. We add 1 for the terminating null character.
@@ -504,7 +504,7 @@ const char* get_last_error_message(Error_message_buf buf)
buf[0]= '\0';
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)buf, sizeof(buf), NULL );
+ (LPTSTR)buf, ERROR_MESSAGE_BUFF_SZ, NULL );
return buf;
}