fix input handling

I think
1 files changed, 3 insertions(+), 2 deletions(-)

M stratcom.lisp
M stratcom.lisp +3 -2
@@ 357,8 357,9 @@ 
            (verify p :REGISTER)
            (check-register p)
            (emit-line (emitter p) (format nil "result = scanf(\"%c\", &input);"))
-           (emit-line (emitter p) (format nil "if(0 == result) { ~a = -1; }" (token-value (current-token p))))
-           (emit-line (emitter p) (format nil "~a = (int)input;" (token-value (current-token p))))
+           (emit-line (emitter p) (format nil "if(result <= 0) { ~a = -1; } else { ~a = (int)input; }"
+                                          (token-value (current-token p))
+                                          (token-value (current-token p))))
            (next-token p))
 
           (t (emit-line (emitter p) (format nil "// FIXME ~a" (current-token p))) (next-token p)))