Update chassis-config.c

This commit is contained in:
tsthght 2018-08-17 18:33:53 +08:00 committed by GitHub
parent b6059212b5
commit 9508678eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,7 +330,7 @@ chassis_config_set_remote_options(chassis_config_t *conf, gchar* key, gchar* val
g_warning("Cannot connect to mysql server.");
return FALSE;
}
char sql[1024] = { 0 }, real_value[1024] = { 0 };
gchar sql[1024] = { 0 }, real_value[1024] = { 0 };
mysql_real_escape_string(conn, real_value, value, strlen(value));
snprintf(sql, sizeof(sql),
"REPLACE INTO %s.`settings`(option_key,option_value) VALUES ('%s', '%s')", conf->schema, key, real_value);