From 3c452b98804a238e65dd45162fe6bae1f0ba66c7 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Mon, 19 Dec 2022 13:37:55 -0700 Subject: [PATCH] util/winutil: fix erroneous condition in implementation of getRegIntegerInternal We only want to log when err != registry.ErrNotExist. The condition was backward. Signed-off-by: Aaron Klotz --- util/winutil/winutil_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/winutil/winutil_windows.go b/util/winutil/winutil_windows.go index 547c5a260..0a35b5f35 100644 --- a/util/winutil/winutil_windows.go +++ b/util/winutil/winutil_windows.go @@ -172,7 +172,7 @@ func deleteRegValueInternal(subKey, name string) error { func getRegIntegerInternal(subKey, name string) (uint64, error) { key, err := registry.OpenKey(registry.LOCAL_MACHINE, subKey, registry.READ) if err != nil { - if err == registry.ErrNotExist { + if err != registry.ErrNotExist { log.Printf("registry.OpenKey(%v): %v", subKey, err) } return 0, err