From b443c1779e39bb056b6045b81ba655c875b45747 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Mon, 28 Aug 2017 13:20:55 -0600 Subject: misc: replace magic number 37 with UUID_STR_LEN Signed-off-by: Philip Prindeville --- sys-utils/swapon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys-utils/swapon.c') diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 641facb1f..1e7d3c0b5 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -67,6 +67,10 @@ #define MAX_PAGESIZE (64 * 1024) +#ifndef UUID_STR_LEN +#define UUID_STR_LEN 37 +#endif + enum { SIG_SWAPSPACE = 1, SIG_SWSUSPEND @@ -485,7 +489,7 @@ static void swap_get_info(struct swap_device *dev, const char *hdr) if (s && *s->uuid) { const unsigned char *u = s->uuid; - char str[37]; + char str[UUID_STR_LEN]; snprintf(str, sizeof(str), "%02x%02x%02x%02x-" -- cgit v1.2.3-55-g7522