Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Limit the number of menu entries in extende...
details: https://anonhg.NetBSD.org/src/rev/8f34c1faf123
branches: trunk
changeset: 461885:8f34c1faf123
user: martin <martin%NetBSD.org@localhost>
date: Sun Jul 14 16:12:02 2019 +0000
description:
Limit the number of menu entries in extended partitioning to the
pre-allocated storage.
Minor cosmetics.
diffstat:
usr.sbin/sysinst/partman.c | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diffs (55 lines):
diff -r 7e9f650c0f89 -r 8f34c1faf123 usr.sbin/sysinst/partman.c
--- a/usr.sbin/sysinst/partman.c Sun Jul 14 16:04:03 2019 +0000
+++ b/usr.sbin/sysinst/partman.c Sun Jul 14 16:12:02 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partman.c,v 1.37 2019/07/14 15:36:57 martin Exp $ */
+/* $NetBSD: partman.c,v 1.38 2019/07/14 16:12:02 martin Exp $ */
/*
* Copyright 2012 Eugene Lozovoy
@@ -2683,10 +2683,23 @@
mount_point = msg_string(MSG_pmmounted);
else
mount_point = msg_string(MSG_pmunused);
- fstype = getfslabelname(info.fs_type, info.fs_sub_type);
- snprintf(buf, STRSIZE, "%s (%s) %s",
- info.last_mounted, fstype, mount_point);
- pm_fmt_disk_line(m->mw, dev, buf, info.size, NULL);
+ fstype = getfslabelname(info.fs_type,
+ info.fs_sub_type);
+ if (info.last_mounted != NULL) {
+ snprintf(buf, STRSIZE, "%s (%s) %s",
+ info.last_mounted, fstype,
+ mount_point);
+ pm_fmt_disk_line(m->mw, dev, buf,
+ info.size, NULL);
+ } else {
+ if (fstype != NULL) {
+ strlcat(dev, " (", sizeof(dev));
+ strlcat(dev, fstype, sizeof(dev));
+ strlcat(dev, ")", sizeof(dev));
+ }
+ pm_fmt_disk_line(m->mw, dev, NULL,
+ info.size, NULL);
+ }
break;
case PM_SPEC:
/* XXX ? */
@@ -2820,6 +2833,8 @@
continue;
if (info.fs_type == FS_UNUSED)
continue;
+ if (i >= MAX_ENTRIES)
+ break;
i++;
m->opts[i].opt_name = NULL;
m->opts[i].opt_exp_name = NULL;
@@ -2841,6 +2856,8 @@
continue;
if (info.fs_type == FS_UNUSED)
continue;
+ if (i >= MAX_ENTRIES)
+ break;
i++;
m->opts[i].opt_name = NULL;
m->opts[i].opt_exp_name = NULL;
Home |
Main Index |
Thread Index |
Old Index