mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
remove cast
C99+TC3, 7.19.7.1p2: [...] the fgetc function obtains that character as an unsigned char converted to an int [...]
This commit is contained in:
@@ -105,7 +105,8 @@ source_file_new(mrb_state *mrb, mrb_debug_context *dbg, char *filename)
|
||||
static mrb_bool
|
||||
remove_newlines(char *s, FILE *fp)
|
||||
{
|
||||
char c, *p;
|
||||
int c;
|
||||
char *p;
|
||||
size_t len;
|
||||
|
||||
if ((len = strlen(s)) == 0) {
|
||||
@@ -120,7 +121,7 @@ remove_newlines(char *s, FILE *fp)
|
||||
|
||||
if (*p == '\r') {
|
||||
/* peek the next character and skip '\n' */
|
||||
if ((unsigned char)(c = fgetc(fp)) != '\n') {
|
||||
if ((c = fgetc(fp)) != '\n') {
|
||||
ungetc(c, fp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user