]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: fix sgi_check_bootfile name size minimum
authormr-bronson <ghbugs@toeai.com>
Sun, 18 Aug 2024 00:54:08 +0000 (00:54 +0000)
committermr-bronson <ghbugs@toeai.com>
Sun, 18 Aug 2024 01:07:52 +0000 (01:07 +0000)
The name does not contain newline, so the comment and logic was wrong.

libfdisk/src/sgi.c

index f2f5073f504e29cd59a0e699ace0d8341e1df63e..2293a20b4080e5a1bab672237ad98ce2d6c395c6 100644 (file)
@@ -391,8 +391,8 @@ static int sgi_check_bootfile(struct fdisk_context *cxt, const char *name)
 
        sz = strlen(name);
 
-       if (sz < 3) {
-               /* "/a\n" is minimum */
+       if (sz < 2) {
+               /* "/a" is minimum */
                fdisk_warnx(cxt, _("Invalid bootfile!  The bootfile must "
                                   "be an absolute non-zero pathname, "
                                   "e.g. \"/unix\" or \"/unix.save\"."));