david/ipxe
Archived
1
0

[settings] Fix erroneous bit-masking in fetch_uintz_setting()

This commit is contained in:
Michael Brown 2009-05-20 08:54:41 +01:00
parent 3961c1ca02
commit c5a88ed553

View File

@ -544,7 +544,8 @@ int fetch_uint_setting ( struct settings *settings, struct setting *setting,
return len;
/* Mask off sign-extended bits */
*value = ( svalue & ( -1UL >> ( sizeof ( long ) - len ) ) );
assert ( len <= ( int ) sizeof ( long ) );
*value = ( svalue & ( -1UL >> ( 8 * ( sizeof ( long ) - len ) ) ) );
return len;
}