From 6afc8bf728853b3989c10731ab4b78302f7bb141 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 3 Mar 2013 05:51:59 +0000 Subject: [PATCH] Put an initializer in the loop control. --- nmap_dns.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nmap_dns.cc b/nmap_dns.cc index d4b271958..ea1c0ee55 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -890,8 +890,7 @@ void win32_read_registry() { if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keybasebuf, 0, KEY_ENUMERATE_SUB_KEYS, &hKey) == ERROR_SUCCESS) { - sz = sizeof(buf); - for (i=0; RegEnumKeyEx(hKey, i, buf, &sz, NULL, NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS; i++) { + for (i=0; sz = sizeof(buf), RegEnumKeyEx(hKey, i, buf, &sz, NULL, NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS; i++) { Snprintf(keyname, sizeof(keyname), "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s", buf); @@ -908,8 +907,6 @@ void win32_read_registry() { RegCloseKey(hKey2); } - - sz = sizeof(buf); } RegCloseKey(hKey);