lib/standard: Changed semantics of read_char and added read_byte for future uses
[nit.git] / lib / standard / file.nit
index bb87a6f..c0a65f7 100644 (file)
@@ -1217,7 +1217,9 @@ end
 # Read a character from the standard input (`stdin`).
 fun getc: Char
 do
-       return sys.stdin.read_char.ascii
+       var c = sys.stdin.read_char
+       if c == null then return '\1'
+       return c
 end
 
 # Read a line from the standard input (`stdin`).