From 10786276da8db4b53c65bf5c45275dd7e5c8b1e5 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 4 Feb 2023 06:20:55 +0200 Subject: [PATCH 14/14] secfile_lookup_str_default(): SECFILE_LOG() in error See osdn #46466 Signed-off-by: Marko Lindqvist --- utility/registry_ini.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utility/registry_ini.c b/utility/registry_ini.c index eda1840f8f..3fba33eb75 100644 --- a/utility/registry_ini.c +++ b/utility/registry_ini.c @@ -2137,8 +2137,8 @@ const char *secfile_lookup_str(const struct section_file *secfile, } /************************************************************************** - Lookup a string value in the secfile. On failure, use the default - value. + Lookup a string value in the secfile. If there's no such key, + return def. Currently returns def also on failure. **************************************************************************/ const char *secfile_lookup_str_default(const struct section_file *secfile, const char *def, @@ -2163,6 +2163,8 @@ const char *secfile_lookup_str_default(const struct section_file *secfile, return str; } + SECFILE_LOG(secfile, NULL, "\"%s\" entry doesn't have a string.", fullpath); + return def; } -- 2.39.1