Cleanup getHexVal()

This commit is contained in:
Michaelangel007 2017-12-11 08:24:54 -08:00
parent ec5681f79e
commit fe10d81843

View File

@ -326,7 +326,7 @@ printf( "ERROR: Create Time not yet implemented\n" );
if( pVal[0] == '$' ) if( pVal[0] == '$' )
{ {
val = getHexVal( pVal + 1 ); val = getHexVal( pVal ); // safely ignores leading $
if( val < 0x00 ) val = 0x00; if( val < 0x00 ) val = 0x00;
if( val > 0xFF ) val = 0xFF; if( val > 0xFF ) val = 0xFF;
entry->type = val; entry->type = val;
@ -352,10 +352,13 @@ printf( "ERROR: Create Time not yet implemented\n" );
nLenSuffix = nLenPrefix - 4; nLenSuffix = nLenPrefix - 4;
pVal = arg + 4; pVal = arg + 4;
val = getHexVal( pVal ); if( pVal[0] == '$' )
if( val < 0x0000 ) val = 0x0000; {
if( val > 0xFFFF ) val = 0xFFFF; val = getHexVal( pVal ); // safely ignores leading $
entry->aux = val; if( val < 0x0000 ) val = 0x0000;
if( val > 0xFFFF ) val = 0xFFFF;
entry->aux = val;
}
} }
else else
if( strncmp( arg, "access=", 7 ) == 0 ) if( strncmp( arg, "access=", 7 ) == 0 )