File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,15 @@ static void listen_keyboard_handler(void)
67
67
read_attr ^= 1 ;
68
68
write (attr_fd , buf , 6 );
69
69
if (!read_attr )
70
- printf ("Stopping to display the chess board...\n" );
70
+ printf ("\n\nStopping to display the chess board...\n" );
71
71
break ;
72
72
case 17 : /* Ctrl-Q */
73
73
read (attr_fd , buf , 6 );
74
74
buf [4 ] = '1' ;
75
75
read_attr = false;
76
76
end_attr = true;
77
77
write (attr_fd , buf , 6 );
78
- printf ("Stopping the kernel space tic-tac-toe game...\n" );
78
+ printf ("\n\nStopping the kernel space tic-tac-toe game...\n" );
79
79
break ;
80
80
}
81
81
}
@@ -117,6 +117,7 @@ int main(int argc, char *argv[])
117
117
FD_CLR (device_fd , & readset );
118
118
printf ("\033[H\033[J" ); /* ASCII escape code to clear the screen */
119
119
read (device_fd , display_buf , DRAWBUFFER_SIZE );
120
+ display_buf [DRAWBUFFER_SIZE - 1 ] = '\0' ;
120
121
printf ("%s" , display_buf );
121
122
}
122
123
}
You can’t perform that action at this time.
0 commit comments