From 540cfb597f080c31533abef5e4a4cf36b6eef413 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Tue, 15 Sep 2020 20:15:13 +0200 Subject: #988 fix compilation warning in json configuration file to legacy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/cfg.c: In function ‘from_json_to_legacy’: src/cfg.c:161:2: warning: format not a string literal and no format arguments [-Wformat-security] --- src/cfg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index c9ed435..bd38a84 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -158,13 +158,13 @@ int parse_json_config(const char *filename, struct og_server_cfg *cfg) void from_json_to_legacy(struct og_server_cfg *cfg) { - snprintf(servidoradm, sizeof(servidoradm), cfg->rest.ip); - snprintf(puerto, sizeof(puerto), cfg->rest.port); - snprintf(usuario, sizeof(usuario), cfg->db.user); - snprintf(pasguor, sizeof(pasguor), cfg->db.pass); - snprintf(datasource, sizeof(datasource), cfg->db.ip); - snprintf(catalog, sizeof(catalog), cfg->db.name); - snprintf(interface, sizeof(interface), cfg->wol.interface); - snprintf(auth_token, sizeof(auth_token), cfg->rest.api_token); + snprintf(servidoradm, sizeof(servidoradm), "%s", cfg->rest.ip); + snprintf(puerto, sizeof(puerto), "%s", cfg->rest.port); + snprintf(usuario, sizeof(usuario), "%s", cfg->db.user); + snprintf(pasguor, sizeof(pasguor), "%s", cfg->db.pass); + snprintf(datasource, sizeof(datasource), "%s", cfg->db.ip); + snprintf(catalog, sizeof(catalog), "%s", cfg->db.name); + snprintf(interface, sizeof(interface), "%s", cfg->wol.interface); + snprintf(auth_token, sizeof(auth_token), "%s", cfg->rest.api_token); snprintf(db_port, sizeof(db_port), "%u", cfg->db.port); } -- cgit v1.2.3-18-g5258