Commit 1de9a055 authored by unknown's avatar unknown

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

parent 7adfe96d
......@@ -381,7 +381,7 @@ unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(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);
my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
......
......@@ -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;
const char *save_csdir= charsets_dir;
......@@ -1518,7 +1518,8 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name)
if (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];
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