From: krw Date: Sun, 13 Jun 2021 14:14:56 +0000 (+0000) Subject: UUID_STR_LEN+1 is less mysterious than '37'. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=34a24b142be75888bb4c3be8b36409d5eaaeaf0d;p=openbsd UUID_STR_LEN+1 is less mysterious than '37'. --- diff --git a/sbin/fdisk/misc.c b/sbin/fdisk/misc.c index 9b2c4f5a65c..2571b87bd7d 100644 --- a/sbin/fdisk/misc.c +++ b/sbin/fdisk/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.66 2021/06/10 15:21:19 krw Exp $ */ +/* $OpenBSD: misc.c,v 1.67 2021/06/13 14:14:56 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -324,7 +324,7 @@ getuint64(char *prompt, uint64_t oval, uint64_t minval, uint64_t maxval) char * ask_string(const char *prompt, const char *oval) { - static char buf[37]; + static char buf[UUID_STR_LEN + 1]; buf[0] = '\0'; printf("%s: [%s] ", prompt, oval ? oval : ""); diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c index 01daf776f61..c5a201c2c6a 100644 --- a/sbin/fdisk/part.c +++ b/sbin/fdisk/part.c @@ -1,4 +1,4 @@ -/* $OpenBSD: part.c,v 1.83 2021/06/12 18:35:37 krw Exp $ */ +/* $OpenBSD: part.c,v 1.84 2021/06/13 14:14:56 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -36,7 +36,7 @@ const char *ascii_id(int); static const struct part_type { int type; char sname[14]; - char guid[37]; + char guid[UUID_STR_LEN + 1]; } part_types[] = { { 0x00, "unused ", "00000000-0000-0000-0000-000000000000" }, { 0x01, "FAT12 ", "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7" }, @@ -391,7 +391,7 @@ PRT_fix_CHS(struct prt *part) char * PRT_uuid_to_typename(struct uuid *uuid) { - static char partition_type[37]; /* Room for a GUID if needed. */ + static char partition_type[UUID_STR_LEN + 1]; char *uuidstr = NULL; int i, entries, status;