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 --- libuuid/src/test_uuid.c | 2 +- libuuid/src/uuid.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'libuuid') diff --git a/libuuid/src/test_uuid.c b/libuuid/src/test_uuid.c index 4d155b533..400d6d8fc 100644 --- a/libuuid/src/test_uuid.c +++ b/libuuid/src/test_uuid.c @@ -68,7 +68,7 @@ static int check_uuids_in_file(const char *file) { int fd, ret = 0; size_t sz; - char str[sizeof("01234567-89ab-cdef-0134-567890abcedf")]; + char str[UUID_STR_LEN]; uuid_t uuidBits; if ((fd = open(file, O_RDONLY)) < 0) { diff --git a/libuuid/src/uuid.h b/libuuid/src/uuid.h index bf4e50063..2fd470558 100644 --- a/libuuid/src/uuid.h +++ b/libuuid/src/uuid.h @@ -99,6 +99,8 @@ extern int uuid_is_null(const uuid_t uu); /* parse.c */ extern int uuid_parse(const char *in, uuid_t uu); +#define UUID_STR_LEN 37 + /* unparse.c */ extern void uuid_unparse(const uuid_t uu, char *out); extern void uuid_unparse_lower(const uuid_t uu, char *out); -- cgit v1.2.3-55-g7522