Since source and destination area overlap, we have to use memmove() here.
This commit is contained in:
parent
9a1c3a9313
commit
a201be5031
@ -1214,7 +1214,7 @@ int bx_gui_c::bx_printf(const char *s)
|
||||
}
|
||||
}
|
||||
if (console.cursor_y == 25) {
|
||||
memcpy(console.screen, console.screen+160, BX_CONSOLE_BUFSIZE-160);
|
||||
memmove(console.screen, console.screen+160, BX_CONSOLE_BUFSIZE-160);
|
||||
console.cursor_y--;
|
||||
offset = console.cursor_y * 160 + console.cursor_x * 2;
|
||||
for (int j = 0; j < 160; j+=2) {
|
||||
@ -1252,7 +1252,7 @@ char* bx_gui_c::bx_gets(char *s, int size)
|
||||
keystr[0] = 0x08;
|
||||
bx_printf(keystr);
|
||||
}
|
||||
memcpy(&console.keys[0], &console.keys[1], 15);
|
||||
memmove(&console.keys[0], &console.keys[1], 15);
|
||||
console.n_keys--;
|
||||
}
|
||||
#if BX_HAVE_USLEEP
|
||||
|
Loading…
Reference in New Issue
Block a user