]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Small fix in the proto file parsing code.
authorRussell Cattelan <cattelan@sgi.com>
Fri, 19 Sep 2003 22:04:49 +0000 (22:04 +0000)
committerRussell Cattelan <cattelan@sgi.com>
Fri, 19 Sep 2003 22:04:49 +0000 (22:04 +0000)
use char type for looking at char's
also strcmp doesn't like having null passed to it.

mkfs/proto.c

index 0339e94c59ee838ce7fe870b16bf2e4a40b91fd5..9ada4abc0caa81ee5245d16bad1438faa6651ed0 100644 (file)
@@ -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);