[sh] Fix a "may be unused" warning on mips-gcc

mips-gcc for mips32 was complaining that c was potentially used before
being set.  Setting it to 0 before calling fdgetsc() looks like the right
thing to do in this instance; there's an explicit check for c == 0 later
on.

Tested: mips-gcc mips32 build, running /bin/sh on mips32
This commit is contained in:
Adrian Chadd 2020-04-16 23:31:39 +00:00
parent 6c88ef1c81
commit 4d0b267a1f

View File

@ -245,6 +245,7 @@ readcmd(int argc __unused, char **argv __unused)
lastnonifs = lastnonifsws = -1;
fdctx_init(STDIN_FILENO, &fdctx);
for (;;) {
c = 0;
nread = fdgetc(&fdctx, &c);
if (nread == -1) {
if (errno == EINTR) {