From 0803634cd12cd540cdaf39b3f6b88ed8fc2fb04b Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 12 Dec 2001 16:22:38 +0000 Subject: [PATCH] o silly bugs --- lib/uuid/uuid.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/uuid/uuid.c b/lib/uuid/uuid.c index c639e4022..96b2a6756 100644 --- a/lib/uuid/uuid.c +++ b/lib/uuid/uuid.c @@ -61,7 +61,6 @@ void _build_inverse(void) int id_valid(struct id *id) { int i; - char lookup[256]; _build_inverse(); @@ -89,7 +88,7 @@ int id_format(struct id *id, char *buffer, size_t size) return 0; for (i = 0; i < GROUPS; i++) { - memcpy(buffer + (i * 5), id.uuid + (i * 4), 4); + memcpy(buffer + (i * 5), id->uuid + (i * 4), 4); buffer[(i * 5) + 4] = '-'; } @@ -99,6 +98,8 @@ int id_format(struct id *id, char *buffer, size_t size) int id_read_format(struct id *id, char *buffer) { + int i; + if (strlen(buffer) < (GROUPS * 5)) { log_err("Insufficient characters to be a proper uuid."); return 0;