minor fix (backport from 5.0) - changed function prototype/definition

parent ff0c7f22
...@@ -381,7 +381,7 @@ unsigned int STDCALL mysql_warning_count(MYSQL *mysql); ...@@ -381,7 +381,7 @@ unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql); const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(MYSQL *mysql); unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
const char * STDCALL mysql_character_set_name(MYSQL *mysql); const char * STDCALL mysql_character_set_name(MYSQL *mysql);
int STDCALL mysql_set_character_set(MYSQL *mysql, char *csname); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
MYSQL * STDCALL mysql_init(MYSQL *mysql); MYSQL * STDCALL mysql_init(MYSQL *mysql);
my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
......
...@@ -1510,7 +1510,7 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql) ...@@ -1510,7 +1510,7 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql)
} }
int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name) int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
{ {
struct charset_info_st *cs; struct charset_info_st *cs;
const char *save_csdir= charsets_dir; const char *save_csdir= charsets_dir;
...@@ -1518,7 +1518,8 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name) ...@@ -1518,7 +1518,8 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name)
if (mysql->options.charset_dir) if (mysql->options.charset_dir)
charsets_dir= mysql->options.charset_dir; charsets_dir= mysql->options.charset_dir;
if ((cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) if (strlen(cs_name) < MY_CS_NAME_SIZE &&
(cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0))))
{ {
char buff[MY_CS_NAME_SIZE + 10]; char buff[MY_CS_NAME_SIZE + 10];
charsets_dir= save_csdir; charsets_dir= save_csdir;
......
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