From 6723c52c46991f4c0dbb683c99c98a4b75d1baa5 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Thu, 6 Oct 2016 09:44:57 +0200 Subject: [PATCH] Fixed function declaration for mysql_error and mysql_info (const char * instead of char *) --- include/mysql.h | 4 ++-- libmariadb/mariadb_lib.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index 4f6b98c1..8c8e60e9 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -486,8 +486,8 @@ my_bool STDCALL mysql_commit(MYSQL *mysql); my_bool STDCALL mysql_rollback(MYSQL *mysql); my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); unsigned int STDCALL mysql_errno(MYSQL *mysql); -char * STDCALL mysql_error(MYSQL *mysql); -char * STDCALL mysql_info(MYSQL *mysql); +const char * STDCALL mysql_error(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); void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *cs); diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index a856637e..c1b42e05 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -3291,12 +3291,12 @@ uint STDCALL mysql_errno(MYSQL *mysql) return mysql ? mysql->net.last_errno : 0; } -char * STDCALL mysql_error(MYSQL *mysql) +const char * STDCALL mysql_error(MYSQL *mysql) { return mysql ? (mysql)->net.last_error : (char *)""; } -char *STDCALL mysql_info(MYSQL *mysql) +const char *STDCALL mysql_info(MYSQL *mysql) { return (mysql)->info; }