Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[settings] Fix erroneous bit-masking in fetch_uintz_setting()
  • Loading branch information
Michael Brown committed May 20, 2009
1 parent 3961c1c commit c5a88ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/settings.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit c5a88ed

Please sign in to comment.