]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix a day-one bug in get_driver_block_major which would result in incorrect
authorNathan Scott <nathans@sgi.com>
Fri, 9 Aug 2002 02:27:11 +0000 (02:27 +0000)
committerNathan Scott <nathans@sgi.com>
Fri, 9 Aug 2002 02:27:11 +0000 (02:27 +0000)
majors being returned for not-found drivers.

libdisk/drivers.c

index af987fc5438db89dac0dcb2a3ee1d4c201b860a5..0468dd452573e0728217a75ebf8ec8785e20a8a4 100644 (file)
@@ -88,7 +88,9 @@ get_driver_block_major(const char *driver)
        while (fgets(buf, sizeof(buf), f))
                if ((sscanf(buf, "%u %s\n", &major, puf) == 2) &&
                    (strncmp(puf, driver, sizeof(puf)) == 0))
-                       break;
+                       goto found;
+       major = -1;
+found:
        fclose(f);
        return major;
 }