From d29d876b5cd6f72ebd9e9068a08c4dabeb6a9ab9 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 31 Jan 2016 15:49:41 +0200 Subject: [PATCH] Returned value was not cleared if key didn't exist. --- od-win32/registry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/od-win32/registry.cpp b/od-win32/registry.cpp index a6e09e35..e578c02a 100644 --- a/od-win32/registry.cpp +++ b/od-win32/registry.cpp @@ -68,6 +68,7 @@ int regsetint (UAEREG *root, const TCHAR *name, int val) int regqueryint (UAEREG *root, const TCHAR *name, int *val) { + *val = 0; if (inimode) { int ret = 0; TCHAR tmp[100]; @@ -106,6 +107,7 @@ int regsetlonglong (UAEREG *root, const TCHAR *name, ULONGLONG val) int regquerylonglong (UAEREG *root, const TCHAR *name, ULONGLONG *val) { + *val = 0; if (inimode) { int ret = 0; TCHAR tmp[100]; @@ -125,7 +127,6 @@ int regquerylonglong (UAEREG *root, const TCHAR *name, ULONGLONG *val) } } - int regquerystr (UAEREG *root, const TCHAR *name, TCHAR *str, int *size) { if (inimode) { -- 2.47.3