aux/ms2, aux/na: fix warnings

aux/na was comparing the return of putc with <0, when it should
have been comparing against EOF, which is not specified as -ve.

aux/ms2 was zero-extending the mask for the address when it
should have been sign extended.
This commit is contained in:
Ori Bernstein 2020-08-10 19:35:05 -07:00
parent c834f535b7
commit 1e315f896d
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ int binary;
int halfswap;
int srec = 2;
uvlong addr;
ulong psize = 4096;
uvlong psize = 4096;
Biobuf stdout;
Fhdr exech;
Biobuf *bio;

View file

@ -826,7 +826,7 @@ yyerror(char *s, ...)
va_start(ap, s);
fprintf(stderr, "%s: %d: ", yyfilename, yyline);
vfprintf(stderr, s, ap);
if (putc('\n', stderr) < 0)
if (putc('\n', stderr) == EOF)
exits("io");
errors++;
va_end(ap);
@ -840,7 +840,7 @@ yywarn(char *s, ...)
va_start(ap, s);
fprintf(stderr, "%s: %d: warning: ", yyfilename, yyline);
vfprintf(stderr, s, ap);
if (putc('\n', stderr) < 0)
if (putc('\n', stderr) == EOF)
exits("io");
warnings++;
va_end(ap);