changeset 37169:2c223acee2db

Ensure isprint only gets input it can handle. Patch by [spunit262 gmail.com].
author reimar
date Thu, 04 Sep 2014 18:54:16 +0000
parents 04f2b82fc98f
children 4fc2db166644
files input/input.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Thu Sep 04 17:55:42 2014 +0000
+++ b/input/input.c	Thu Sep 04 18:54:16 2014 +0000
@@ -1472,7 +1472,7 @@
       return key_names[i].name;
   }
 
-  if(isprint(key)) {
+  if(0 <= key && key <= 255 && isprint(key)) {
     snprintf(key_str,12,"%c",(char)key);
     return key_str;
   }