mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings related to the use of the deprecated gets() function and passing NULL to non-pointer argument of the sys_var constructor.
This commit is contained in:
parent
ea4c11f923
commit
96c99602d4
2 changed files with 13 additions and 12 deletions
|
@ -181,7 +181,7 @@ mysql_declare_plugin_end;
|
|||
To support all this variety, the dialog plugin has a callback function
|
||||
"authentication_dialog_ask". If the client has a function of this name
|
||||
dialog plugin will use it for communication with the user. Otherwise
|
||||
a default gets() based implementation will be used.
|
||||
a default fgets() based implementation will be used.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -208,12 +208,15 @@ 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)
|
||||
{
|
||||
char *ptr;
|
||||
fputs(prompt, stdout);
|
||||
fputc(' ', stdout);
|
||||
if (gets(buf) == 0)
|
||||
return 0;
|
||||
if (fgets(buf, buf_len, stdin) == NULL)
|
||||
return NULL;
|
||||
if ((ptr= strchr(buf, '\n')))
|
||||
*ptr= 0;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -460,10 +460,8 @@ public:
|
|||
const char *comment, enum charset_enum is_os_charset_arg)
|
||||
: sys_var(&all_sys_vars, name_arg, comment,
|
||||
sys_var::READONLY+sys_var::ONLY_SESSION, 0, -1,
|
||||
NO_ARG, SHOW_CHAR, (intptr)NULL,
|
||||
0, VARIABLE_NOT_IN_BINLOG,
|
||||
0, 0,
|
||||
0, 0, PARSE_NORMAL)
|
||||
NO_ARG, SHOW_CHAR, 0, NULL, VARIABLE_NOT_IN_BINLOG,
|
||||
NULL, NULL, 0, NULL, PARSE_NORMAL)
|
||||
{
|
||||
is_os_charset= is_os_charset_arg == IN_FS_CHARSET;
|
||||
option.var_type= GET_STR;
|
||||
|
|
Loading…
Reference in a new issue