From 201a077b2ccb8cd01b77396c1f88e07cbcb11d1e Mon Sep 17 00:00:00 2001 From: Raheman Vaiya Date: Sat, 19 Aug 2023 13:03:23 -0400 Subject: [PATCH] Fix name length warning --- src/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 2129db0..2fe1014 100644 --- a/src/config.c +++ b/src/config.c @@ -366,11 +366,11 @@ static int new_layer(char *s, const struct config *config, struct layer *layer) static int config_add_layer(struct config *config, const char *s) { int ret; - char buf[MAX_LAYER_NAME_LEN]; + char buf[MAX_LAYER_NAME_LEN+1]; char *name; if (strlen(s) >= sizeof buf) { - err("%s exceeds maximum section length(%d) (ignoring)", s, MAX_LAYER_NAME_LEN); + err("%s exceeds maximum section length (%d) (ignoring)", s, MAX_LAYER_NAME_LEN); return -1; }