From 93ca7b42cdaccb7d6203db7970cbb1dd19368648 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Sun, 22 Sep 2019 10:23:36 +0800 Subject: [PATCH] ini_file_reader.c: fix empty string compare --- HISTORY | 5 +++++ src/ini_file_reader.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 9301c64..d674de0 100644 --- a/HISTORY +++ b/HISTORY @@ -1,4 +1,9 @@ + +Version 1.41 2019-09-22 + * change CIDR network_bits range from [16, 32) to [10, 32) + * ini_file_reader.c: fix empty string compare + Version 1.40 2018-11-09 * add function conn_pool_parse_server_info and conn_pool_load_server_info * support directive: #@add_annotation, for example: diff --git a/src/ini_file_reader.c b/src/ini_file_reader.c index 6fc16e4..3eac70b 100644 --- a/src/ini_file_reader.c +++ b/src/ini_file_reader.c @@ -851,14 +851,14 @@ static int iniAddAnnotation(char *params) func_name = fc_trim(cols[0]); library = fc_trim(cols[1]); - if (func_name == '\0') + if (*func_name == '\0') { logError("file: "__FILE__", line: %d, " "empty func name, correct format: " "#@add_annotation FUNC_NAME library ...", __LINE__); return EINVAL; } - if (library == '\0') + if (*library == '\0') { logError("file: "__FILE__", line: %d, " "empty library, correct format: "