mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fixed compiler warning from strncpy in mysql_plugin.c
This commit is contained in:
@@ -738,8 +738,8 @@ static int check_options(int argc, char **argv, char *operation)
|
|||||||
{
|
{
|
||||||
int i= 0; /* loop counter */
|
int i= 0; /* loop counter */
|
||||||
int num_found= 0; /* number of options found (shortcut loop) */
|
int num_found= 0; /* number of options found (shortcut loop) */
|
||||||
char config_file[FN_REFLEN]; /* configuration file name */
|
char config_file[FN_REFLEN+1]; /* configuration file name */
|
||||||
char plugin_name[FN_REFLEN]; /* plugin name */
|
char plugin_name[FN_REFLEN+1]; /* plugin name */
|
||||||
|
|
||||||
/* Form prefix strings for the options. */
|
/* Form prefix strings for the options. */
|
||||||
const char *basedir_prefix = "--basedir=";
|
const char *basedir_prefix = "--basedir=";
|
||||||
@@ -787,8 +787,8 @@ static int check_options(int argc, char **argv, char *operation)
|
|||||||
/* read the plugin config file and check for match against argument */
|
/* read the plugin config file and check for match against argument */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (safe_strcpy_truncated(plugin_name, sizeof plugin_name, argv[i]) ||
|
if (safe_strcpy_truncated(plugin_name, sizeof(plugin_name)-1, argv[i]) ||
|
||||||
safe_strcpy_truncated(config_file, sizeof config_file, argv[i]) ||
|
safe_strcpy_truncated(config_file, sizeof(config_file)-1, argv[i]) ||
|
||||||
safe_strcat(config_file, sizeof(config_file), ".ini"))
|
safe_strcat(config_file, sizeof(config_file), ".ini"))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: argument is too long.\n");
|
fprintf(stderr, "ERROR: argument is too long.\n");
|
||||||
|
Reference in New Issue
Block a user