diff options
author | Gustav HÃ¥llberg <gustav@gmail.com> | 2008-12-29 19:36:06 (GMT) |
---|---|---|
committer | Gustav HÃ¥llberg <gustav@gmail.com> | 2009-01-16 23:34:19 (GMT) |
commit | 8b5e00d0d36aa59d86cf6d6e8e710817a7ee772a (patch) | |
tree | 19d3a707c0f3d5fc5f86add5966ac6b24030703d /tty.c | |
parent | ba902ad54b651134a1261c9f4be227a462c54f3b (diff) | |
download | powwow-8b5e00d0d36aa59d86cf6d6e8e710817a7ee772a.zip powwow-8b5e00d0d36aa59d86cf6d6e8e710817a7ee772a.tar.gz powwow-8b5e00d0d36aa59d86cf6d6e8e710817a7ee772a.tar.bz2 |
fixed some compilation warnings
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -478,10 +478,10 @@ void tty_add_initial_binds __P0 (void) add_keynode(p->label, p->seq, 0, p->funct, NULL); } while((++p)->seq[0]); - if (cursor_left ) add_keynode("Left" , cursor_left , 0, prev_char, NULL); - if (cursor_right) add_keynode("Right", cursor_right, 0, next_char, NULL); - if (cursor_up ) add_keynode("Up" , cursor_up , 0, prev_line, NULL); - if (cursor_down ) add_keynode("Down" , cursor_down , 0, next_line, NULL); + if (*cursor_left ) add_keynode("Left" , cursor_left , 0, prev_char, NULL); + if (*cursor_right) add_keynode("Right", cursor_right, 0, next_char, NULL); + if (*cursor_up ) add_keynode("Up" , cursor_up , 0, prev_line, NULL); + if (*cursor_down ) add_keynode("Down" , cursor_down , 0, next_line, NULL); } #ifndef USE_VT100 @@ -853,7 +853,8 @@ int tty_read __P ((char *buf, size_t count)) int result = 0; int converted; wchar_t wc; - + int did_read = 0, should_read = 0; + if (count && tty_in_buf_used) { converted = mbtowc(&wc, tty_in_buf, tty_in_buf_used); if (converted >= 0) @@ -861,9 +862,9 @@ int tty_read __P ((char *buf, size_t count)) } while (count) { - int should_read = sizeof tty_in_buf - tty_in_buf_used; - int did_read = read(tty_read_fd, tty_in_buf + tty_in_buf_used, - should_read); + should_read = sizeof tty_in_buf - tty_in_buf_used; + did_read = read(tty_read_fd, tty_in_buf + tty_in_buf_used, + should_read); if (did_read < 0 && errno == EINTR) continue; |