diff --git a/src/winio.c b/src/winio.c
index f2b6f4b9c1656ff2d194a50bc099b6d859ff6c3c..ae6a1290b3fef4bde4ef17493806532ffa3edffa 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -122,7 +122,8 @@ void reset_kbinput(void)
  * default keystroke buffer is empty. */
 void get_key_buffer(WINDOW *win)
 {
-    int input, errcount;
+    int input;
+    size_t errcount;
 
     /* If the keystroke buffer isn't empty, get out. */
     if (key_buffer != NULL)