From f19a46edda3554dd9da36550a202eb616fa7056c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 4 Feb 2023 06:18:24 +0200 Subject: [PATCH 27/27] 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 3c9f818870..3fa17dcd9d 100644 --- a/utility/registry_ini.c +++ b/utility/registry_ini.c @@ -2199,8 +2199,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, @@ -2225,6 +2225,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