View | Details | Raw Unified | Return to bug 232087
Collapse All | Expand All

(-)Makefile (-3 lines)
Lines 9-17 Link Here
9
9
10
LICENSE=	ISCL
10
LICENSE=	ISCL
11
11
12
BROKEN_mips=		fails to compile: libsmart.c:241: storage size of 's' is not constant
13
BROKEN_mips64=		fails to compile: libsmart.c:241: storage size of 's' is not constant
14
BROKEN_powerpc64=	fails to compile: libsmart.c:241: storage size of 's' is not constant
15
IGNORE_FreeBSD_10=	Requires FreeBSD 11 or later
12
IGNORE_FreeBSD_10=	Requires FreeBSD 11 or later
16
13
17
USE_GITHUB=	yes
14
USE_GITHUB=	yes
(-)files/patch-libsmart.c (+22 lines)
Line 0 Link Here
1
--- libsmart.c.orig	2018-10-08 21:14:49 UTC
2
+++ libsmart.c
3
@@ -23,6 +23,7 @@
4
 #include "libsmart.h"
5
 #include "libsmart_priv.h"
6
 #include "libsmart_dev.h"
7
+#define MAX_LEN 44
8
 
9
 /* Default page lists */
10
 smart_page_list_t pg_list_ata = {
11
@@ -237,9 +238,8 @@ static char *
12
 __smart_u128_str(smart_attr_t *sa)
13
 {
14
 	/* log10(x) = log2(x) / log2(10) ~= log2(x) / 3.322 */
15
-	const uint32_t max_len = 128 / 3 + 1 + 1;
16
-	static char s[max_len];
17
-	char *p = s + max_len - 1;
18
+	static char s[MAX_LEN];
19
+	char *p = s + MAX_LEN - 1;
20
 	uint32_t *a = (uint32_t *)sa->raw;
21
 	uint64_t r, d;
22
 	uint32_t last = 0;

Return to bug 232087