@@ 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)))