From f81a5a84d3d5fc941b624c28b1ab70971cc23ac9 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 2 Jul 2017 22:12:18 +0200 Subject: [PATCH] write_mongodb: fix build warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CC src/write_mongodb_la-write_mongodb.lo src/write_mongodb.c: In function ‘wm_config’: src/write_mongodb.c:371:55: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 114 [-Wformat-truncation=] snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name); ^~ src/write_mongodb.c:371:5: note: ‘snprintf’ output between 15 and 142 bytes into a destination of size 128 snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/write_mongodb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_mongodb.c b/src/write_mongodb.c index 2cb4537b..37e34098 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -366,7 +366,7 @@ static int wm_config_node(oconfig_item_t *ci) /* {{{ */ } if (status == 0) { - char cb_name[DATA_MAX_NAME_LEN]; + char cb_name[sizeof("write_mongodb/") + DATA_MAX_NAME_LEN]; snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name); -- 2.11.0