summaryrefslogtreecommitdiff
path: root/src/sp_var_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_var_parser.c')
-rw-r--r--src/sp_var_parser.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/sp_var_parser.c b/src/sp_var_parser.c
index 8e5bdb1..b57386e 100644
--- a/src/sp_var_parser.c
+++ b/src/sp_var_parser.c
@@ -24,9 +24,8 @@ static bool is_var_name_valid(const char *name) {
24 static sp_pcre *regexp_const = NULL; 24 static sp_pcre *regexp_const = NULL;
25 static sp_pcre *regexp_var = NULL; 25 static sp_pcre *regexp_var = NULL;
26 26
27 if (!name) { 27 assert(name);
28 return false; 28
29 }
30 if (NULL == regexp_var || NULL == regexp_const) { 29 if (NULL == regexp_var || NULL == regexp_const) {
31 regexp_var = sp_pcre_compile(REGEXP_VAR); 30 regexp_var = sp_pcre_compile(REGEXP_VAR);
32 regexp_const = sp_pcre_compile(REGEXP_CONST); 31 regexp_const = sp_pcre_compile(REGEXP_CONST);
@@ -46,9 +45,8 @@ static int create_var(sp_tree *tree, const char *restrict value,
46 const char *restrict idx) { 45 const char *restrict idx) {
47 sp_tree *var_node = NULL; 46 sp_tree *var_node = NULL;
48 47
49 if (!tree) { 48 assert(tree);
50 return -1; 49
51 }
52 if (tree->next == NULL && tree->type == UNDEFINED) { 50 if (tree->next == NULL && tree->type == UNDEFINED) {
53 var_node = tree; 51 var_node = tree;
54 } else { 52 } else {