diff options
Diffstat (limited to '')
| -rw-r--r-- | inout.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -4,7 +4,7 @@ | |||
| 4 | ** facilities. | 4 | ** facilities. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | char *rcs_inout="$Id: inout.c,v 2.3 1994/09/05 21:22:43 celes Exp celes $"; | 7 | char *rcs_inout="$Id: inout.c,v 2.4 1994/10/11 14:38:17 celes Exp $"; |
| 8 | 8 | ||
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| 10 | #include <stdlib.h> | 10 | #include <stdlib.h> |
| @@ -46,8 +46,7 @@ void lua_errorfunction (void (*fn) (char *s)) | |||
| 46 | */ | 46 | */ |
| 47 | static int fileinput (void) | 47 | static int fileinput (void) |
| 48 | { | 48 | { |
| 49 | int c = fgetc (fp); | 49 | return fgetc (fp); |
| 50 | return (c == EOF ? 0 : c); | ||
| 51 | } | 50 | } |
| 52 | 51 | ||
| 53 | /* | 52 | /* |
| @@ -55,8 +54,7 @@ static int fileinput (void) | |||
| 55 | */ | 54 | */ |
| 56 | static int stringinput (void) | 55 | static int stringinput (void) |
| 57 | { | 56 | { |
| 58 | st++; | 57 | return *st++; |
| 59 | return (*(st-1)); | ||
| 60 | } | 58 | } |
| 61 | 59 | ||
| 62 | /* | 60 | /* |
