File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 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)
6767 read_attr ^= 1 ;
6868 write (attr_fd , buf , 6 );
6969 if (!read_attr )
70- printf ("Stopping to display the chess board...\n" );
70+ printf ("\n\nStopping to display the chess board...\n" );
7171 break ;
7272 case 17 : /* Ctrl-Q */
7373 read (attr_fd , buf , 6 );
7474 buf [4 ] = '1' ;
7575 read_attr = false;
7676 end_attr = true;
7777 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" );
7979 break ;
8080 }
8181 }
@@ -117,6 +117,7 @@ int main(int argc, char *argv[])
117117 FD_CLR (device_fd , & readset );
118118 printf ("\033[H\033[J" ); /* ASCII escape code to clear the screen */
119119 read (device_fd , display_buf , DRAWBUFFER_SIZE );
120+ display_buf [DRAWBUFFER_SIZE - 1 ] = '\0' ;
120121 printf ("%s" , display_buf );
121122 }
122123 }
You can’t perform that action at this time.
0 commit comments