diff options
Diffstat (limited to 'code/sys')
-rw-r--r-- | code/sys/con_tty.c | 20 | ||||
-rw-r--r-- | code/sys/sys_unix.c | 5 |
2 files changed, 16 insertions, 9 deletions
diff --git a/code/sys/con_tty.c b/code/sys/con_tty.c index c2e553a..28f1fd4 100644 --- a/code/sys/con_tty.c +++ b/code/sys/con_tty.c @@ -86,12 +86,14 @@ send "\b \b" static void CON_Back( void ) { char key; + size_t size; + key = '\b'; - write(1, &key, 1); + size = write(1, &key, 1); key = ' '; - write(1, &key, 1); + size = write(1, &key, 1); key = '\b'; - write(1, &key, 1); + size = write(1, &key, 1); } /* @@ -142,12 +144,13 @@ static void CON_Show( void ) ttycon_hide--; if (ttycon_hide == 0) { - write( 1, "]", 1 ); + size_t size; + size = write( 1, "]", 1 ); if (TTY_con.cursor) { for (i=0; i<TTY_con.cursor; i++) { - write(1, TTY_con.buffer+i, 1); + size = write(1, TTY_con.buffer+i, 1); } } } @@ -307,6 +310,7 @@ char *CON_Input( void ) int avail; char key; field_t *history; + size_t size; if( ttycon_on ) { @@ -336,8 +340,8 @@ char *CON_Input( void ) strcpy(text, TTY_con.buffer); Field_Clear(&TTY_con); key = '\n'; - write(1, &key, 1); - write( 1, "]", 1 ); + size = write(1, &key, 1); + size = write( 1, "]", 1 ); return text; } if (key == '\t') @@ -399,7 +403,7 @@ char *CON_Input( void ) TTY_con.buffer[TTY_con.cursor] = key; TTY_con.cursor++; // print the current line (this is differential) - write(1, &key, 1); + size = write(1, &key, 1); } return NULL; diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 21d0b57..c05fda5 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -231,7 +231,10 @@ char *Sys_Cwd( void ) { static char cwd[MAX_OSPATH]; - getcwd( cwd, sizeof( cwd ) - 1 ); + char *result = getcwd( cwd, sizeof( cwd ) - 1 ); + if( result != cwd ) + return NULL; + cwd[MAX_OSPATH-1] = 0; return cwd; |