From c3b03d0701d8b82d60784e729ece9cb2f650eb87 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 24 Aug 2020 13:32:59 -0400 Subject: [PATCH] Appease GCC sprintf warnings found on Fedora 32/GCC 10.0.1 Increase the size of DDT_NAMELEN and MNT_LINE_MAX to appease GCC snprintf truncation warnings. Reviewed-by: Brian Behlendorf Signed-off-by: Chris McDonough Closes #10712 Closes #10766 --- include/sys/ddt.h | 2 +- lib/libspl/include/os/freebsd/sys/mnttab.h | 2 +- lib/libspl/include/os/linux/sys/mnttab.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sys/ddt.h b/include/sys/ddt.h index 4fba49c75c..25be6f56dd 100644 --- a/include/sys/ddt.h +++ b/include/sys/ddt.h @@ -179,7 +179,7 @@ typedef struct ddt_ops { int (*ddt_op_count)(objset_t *os, uint64_t object, uint64_t *count); } ddt_ops_t; -#define DDT_NAMELEN 102 +#define DDT_NAMELEN 107 extern void ddt_object_name(ddt_t *ddt, enum ddt_type type, enum ddt_class clazz, char *name); diff --git a/lib/libspl/include/os/freebsd/sys/mnttab.h b/lib/libspl/include/os/freebsd/sys/mnttab.h index eb6ea2433a..c08349bdf9 100644 --- a/lib/libspl/include/os/freebsd/sys/mnttab.h +++ b/lib/libspl/include/os/freebsd/sys/mnttab.h @@ -43,7 +43,7 @@ #define MS_NOMNTTAB 0x0 #define MS_RDONLY 0x1 #define umount2(p, f) unmount(p, f) -#define MNT_LINE_MAX 4096 +#define MNT_LINE_MAX 4108 #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */ #define MNT_TOOMANY 2 /* too many fields in line */ diff --git a/lib/libspl/include/os/linux/sys/mnttab.h b/lib/libspl/include/os/linux/sys/mnttab.h index 093218d685..1957293d5c 100644 --- a/lib/libspl/include/os/linux/sys/mnttab.h +++ b/lib/libspl/include/os/linux/sys/mnttab.h @@ -40,7 +40,7 @@ #endif /* MNTTAB */ #define MNTTAB "/proc/self/mounts" -#define MNT_LINE_MAX 4096 +#define MNT_LINE_MAX 4108 #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */ #define MNT_TOOMANY 2 /* too many fields in line */