diff -r a285ee393860 -r ed440bcd9740 src/input.c --- a/src/input.c Mon Apr 07 17:39:46 2014 +0200 +++ b/src/input.c Tue Apr 08 21:13:28 2014 +0200 @@ -28,6 +28,7 @@ */ #include "input.h" +#include void init_colorpairs() { init_pair(COL_YB, COLOR_YELLOW, COLOR_BLUE); @@ -70,6 +71,7 @@ static size_t pos = 0; if (*str == '\0') { + memset(str, 0, len); pos = 0; } @@ -88,7 +90,7 @@ str[--pos] = '\0'; break; default: - if (c < 255 && pos < len-1) { + if (isprint(c) && pos < len-1) { str[pos++] = (char) c; } }