mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fgetc(3) returns int.
Note: "char" is actually "unsigned char" on some platforms including NetBSD/arm. Comparing char value with EOF(-1) always fails on the platforms.
This commit is contained in:
+2
-2
@@ -145,7 +145,7 @@ for_each_gem (char before[1024], char after[1024],
|
||||
{
|
||||
/* active GEM check */
|
||||
FILE *active_gem_file;
|
||||
char gem_char;
|
||||
int gem_char;
|
||||
char gem_name[1024] = { 0 };
|
||||
int char_index;
|
||||
char gem_list[1024][1024] = { { 0 }, { 0 } };
|
||||
@@ -166,7 +166,7 @@ for_each_gem (char before[1024], char after[1024],
|
||||
char_index = 0;
|
||||
gem_index = 0;
|
||||
skip = FALSE;
|
||||
while((gem_char = fgetc(active_gem_file)) != EOF) {
|
||||
while ((gem_char = fgetc(active_gem_file)) != EOF) {
|
||||
if (gem_char == '\n') {
|
||||
/* Every line contains one active GEM */
|
||||
gem_name[char_index++] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user