Fixed wrong type of var get in function rot8_io.c/read_type
This commit is contained in:
1 parent
853a6c50d9
commit
e91b01c7d4
2 files changed
+2
-1
No files matched your search
+2
-1
@@ -20,7 +20,8 @@ void read_tape(const char *filename, char *tape) {
|
||||
|
||||
FILE *fp = fopen(filename, "r");
|
||||
|
||||
char get;
|
||||
int get; // Attention, the return value of fgetc's type is int!!!
|
||||
// On ARM, char <=> unsigned char,if "char get",EOF(-1) will assign 255 to "get",making the comparison always TRUE
|
||||
while ((get = fgetc(fp)) != EOF) {
|
||||
if (strchr("><+-[].,", get) != NULL) {
|
||||
*tail = get;
|
||||
|
||||
Reference in new issue
Block a user