summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-09-15 20:15:13 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-09-15 20:16:12 +0200
commit540cfb597f080c31533abef5e4a4cf36b6eef413 (patch)
treef7ba0efa7bef0dff4a73051f2fd42760c659cf97
parentff71a2ad6e87a7ce5912cfc95fbcc772b22736f3 (diff)
#988 fix compilation warning in json configuration file to legacy
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]
-rw-r--r--src/cfg.c16
1 files 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);
}