From 8ee9c636682c28eac0e30a633a7ef75cc77ebf8b Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 8 Apr 2010 16:02:49 +0300 Subject: [PATCH] Fixed compiler warnings Changed version string to beta client/mysql.cc: Fixed compiler warning configure.in: Changed version string to beta plugin/auth/dialog.c: Fixed compiler warning (gets() is a not recommended function) --- client/mysql.cc | 5 +++-- configure.in | 2 +- plugin/auth/dialog.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 08e53df75fe..bfaed00b49f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -4288,8 +4288,9 @@ extern "C" char *mysql_authentication_dialog_ask(MYSQL *mysql, int type, } else { - fgets(buf, buf_len-1, stdin); - if (buf[0] && (s= strend(buf))[-1] == '\n') + if (!fgets(buf, buf_len-1, stdin)) + buf[0]= 0; + else if (buf[0] && (s= strend(buf))[-1] == '\n') s[-1]= 0; } diff --git a/configure.in b/configure.in index 006960fcd8d..5598692626f 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ AC_PREREQ(2.59) # MySQL version number. # # Note: the following line must be parseable by win/configure.js:GetVersion() -AC_INIT([MariaDB Server], [5.2.0-MariaDB-alpha], [], [mysql]) +AC_INIT([MariaDB Server], [5.2.0-MariaDB-beta], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM # USTAR format gives us the possibility to store longer path names in diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index 95998fcc0d0..4fa1b5e66e5 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -224,11 +224,11 @@ static mysql_authentication_dialog_ask_t ask; static char *builtin_ask(MYSQL *mysql __attribute__((unused)), int type __attribute__((unused)), const char *prompt, - char *buf, int buf_len __attribute__((unused))) + char *buf, int buf_len) { fputs(prompt, stdout); fputc(' ', stdout); - if (gets(buf) == 0) + if (fgets(buf, buf_len, stdin) == 0) return 0; return buf;