x86 setup: sizeof() is unsigned, unbreak comparisons
We use signed values for limit checking since the values can go negative under certain circumstances. However, sizeof() is unsigned and forces the comparison to be unsigned, so move the comparison into the heap_free() macros so we can ensure it is a signed comparison. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
@ -371,7 +371,7 @@ static void save_screen(void)
|
||||
saved.curx = boot_params.screen_info.orig_x;
|
||||
saved.cury = boot_params.screen_info.orig_y;
|
||||
|
||||
if (heap_free() < saved.x*saved.y*sizeof(u16)+512)
|
||||
if (!heap_free(saved.x*saved.y*sizeof(u16)+512))
|
||||
return; /* Not enough heap to save the screen */
|
||||
|
||||
saved.data = GET_HEAP(u16, saved.x*saved.y);
|
||||
|
Reference in New Issue
Block a user