From: mr-bronson Date: Sun, 18 Aug 2024 00:54:08 +0000 (+0000) Subject: fdisk: fix sgi_check_bootfile name size minimum X-Git-Tag: v2.40.3~45 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4b155cbf48e80328626b6c94ee6f9c121765d59;p=thirdparty%2Futil-linux.git fdisk: fix sgi_check_bootfile name size minimum The name does not contain newline, so the comment and logic was wrong. (cherry picked from commit 6dfc07a7189eea461d52ff85620b286a4817a658) --- diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c index f2f5073f5..2293a20b4 100644 --- a/libfdisk/src/sgi.c +++ b/libfdisk/src/sgi.c @@ -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\"."));