Skip to content

Commit

Permalink
vga: use memmove instead of memcpy
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Mazein <[email protected]>
  • Loading branch information
MegaMaddin committed Sep 3, 2020
1 parent d131908 commit 280e9fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ void vga_write(const char *buf, size_t len, vga_color_t color) {

/* Scroll up one row when hit end of VGA area */
if (row == (MAX_ROWS - 1)) {
memcpy(vga_buffer[0], vga_buffer[1], sizeof(vga_buffer) - MAX_COLS);
memmove(vga_buffer[0], vga_buffer[1],
sizeof(vga_buffer) - sizeof(vga_buffer[0]));
memset(vga_buffer[MAX_ROWS - 1], 0x00, MAX_COLS);
col = 0;
row--;
Expand Down

0 comments on commit 280e9fb

Please sign in to comment.