Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Fix overlapping partitions display



details:   https://anonhg.NetBSD.org/src/rev/f8ab80b35db4
branches:  trunk
changeset: 847228:f8ab80b35db4
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Dec 15 11:22:46 2019 +0000

description:
Fix overlapping partitions display

diffstat:

 usr.sbin/sysinst/label.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (61 lines):

diff -r 24fe677d111a -r f8ab80b35db4 usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c  Sun Dec 15 10:12:45 2019 +0000
+++ b/usr.sbin/sysinst/label.c  Sun Dec 15 11:22:46 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: label.c,v 1.16 2019/12/13 22:12:41 martin Exp $        */
+/*     $NetBSD: label.c,v 1.17 2019/12/15 11:22:46 martin Exp $        */
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.16 2019/12/13 22:12:41 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.17 2019/12/15 11:22:46 martin Exp $");
 #endif
 
 #include <sys/types.h>
@@ -60,8 +60,7 @@
  * local prototypes
  */
 static bool boringpart(const struct disk_part_info *info);
-static bool checklabel(struct disk_partitions*, char[MENUSTRSIZE],
-    char[MENUSTRSIZE]);
+static bool checklabel(struct disk_partitions*, char *, char *);
 static void show_partition_adder(menudesc *, struct partition_usage_set*);
 
 /*
@@ -107,7 +106,7 @@
  */
 static bool
 checklabel(struct disk_partitions *parts,
-    char ovl1[MENUSTRSIZE], char ovl2[MENUSTRSIZE])
+    char *ovl1, char *ovl2)
 {
        part_id i, j;
        struct disk_part_info info;
@@ -124,7 +123,7 @@
 
                /*
                 * check succeeding partitions for overlap.
-                * O(n^2), but n is small (currently <= 16).
+                * O(n^2), but n is small.
                 */
                istart = info.start;
                iend = istart + info.size;
@@ -146,12 +145,12 @@
                        /* overlap? */
                        if ((istart <= jstart && jstart < iend) ||
                            (jstart <= istart && istart < jend)) {
-                               snprintf(ovl1, sizeof(*ovl1),
+                               snprintf(ovl1, MENUSTRSIZE,
                                    "%" PRIu64 " - %" PRIu64 " %s, %s",
                                    istart / sizemult, iend / sizemult,
                                    multname,
                                    getfslabelname(fs_type, fs_sub_type));
-                               snprintf(ovl2, sizeof(*ovl2),
+                               snprintf(ovl2, MENUSTRSIZE,
                                    "%" PRIu64 " - %" PRIu64 " %s, %s",
                                    jstart / sizemult, jend / sizemult,
                                    multname,



Home | Main Index | Thread Index | Old Index