From: Russell Cattelan Date: Fri, 19 Sep 2003 22:04:49 +0000 (+0000) Subject: Small fix in the proto file parsing code. X-Git-Tag: v2.6.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0b22cc7663b148e1ca3b2a841e9c6ca3d9a5996;p=thirdparty%2Fxfsprogs-dev.git Small fix in the proto file parsing code. use char type for looking at char's also strcmp doesn't like having null passed to it. --- diff --git a/mkfs/proto.c b/mkfs/proto.c index 0339e94c5..9ada4abc0 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -148,7 +148,7 @@ static char * getstr( char **pp) { - int c; + char c; char *p; char *rval; @@ -174,7 +174,7 @@ getstr( return rval; } } - if (!c) { + if (c != '\0') { fprintf(stderr, _("%s: premature EOF in prototype file\n"), progname); exit(1); @@ -594,6 +594,8 @@ parseproto( tp = NULL; for (;;) { name = getstr(pp); + if (!name) + break; if (strcmp(name, "$") == 0) break; parseproto(mp, ip, pp, name);