Commit 8767ee3e authored by David Elliott's avatar David Elliott Committed by Alexandre Julliard

Fixed usage of RegEnumValueA.

parent 87f98a58
...@@ -459,7 +459,7 @@ SCSI_MapHCtoController() ...@@ -459,7 +459,7 @@ SCSI_MapHCtoController()
DWORD disposition; DWORD disposition;
char idstr[20]; char idstr[20];
DWORD cbIdStr = 20; DWORD cbIdStr;
int i = 0; int i = 0;
DWORD type = 0; DWORD type = 0;
DWORD error; DWORD error;
...@@ -487,9 +487,15 @@ SCSI_MapHCtoController() ...@@ -487,9 +487,15 @@ SCSI_MapHCtoController()
return; return;
} }
for( i=0; (error=RegEnumValueA( hkeyScsi, i, idstr, &cbIdStr, NULL, &type, NULL, NULL )) == ERROR_SUCCESS; i++ ) for( i=0; cbIdStr = sizeof(idstr), (error=RegEnumValueA( hkeyScsi, i, idstr, &cbIdStr, NULL, &type, NULL, NULL )) == ERROR_SUCCESS; i++ )
{ {
sscanf(idstr, "h%02dc%02dt%*02dd%*02d", &ha, &chan); if(idstr[0] == '\0') continue; /* skip the default value */
if(sscanf(idstr, "h%02dc%02dt%*02dd%*02d", &ha, &chan) != 2) {
ERR("incorrect reg. value %s\n", debugstr_a(idstr));
continue;
}
if( last_ha < ha ) if( last_ha < ha )
{ /* Next HA */ { /* Next HA */
last_ha = ha; last_ha = ha;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment