From ca51803abbe0b5605f936f5676d9c1a528713033 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 23 Oct 2017 23:40:06 +0200 Subject: Add a test for unmatched brackets --- src/sp_config_utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/sp_config_utils.c') diff --git a/src/sp_config_utils.c b/src/sp_config_utils.c index f562ffd..62fb7c1 100644 --- a/src/sp_config_utils.c +++ b/src/sp_config_utils.c @@ -2,9 +2,7 @@ size_t sp_line_no; -static int validate_str(const char *value); - -static sp_pure int validate_str(const char *value) { +static int validate_str(const char *value) { int balance = 0; // ghetto [] validation if (!strchr(value, '[')) { @@ -18,6 +16,7 @@ static sp_pure int validate_str(const char *value) { balance--; } if (balance < 0) { + sp_log_err("config", "The string '%s' contains unbalanced brackets.", value); return -1; } } -- cgit v1.3