From db25ccd0955d50204ef020aaa45e68f43b87dd9c Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Wed, 28 Oct 2009 19:26:38 +0000 Subject: [PATCH] * Fix one more uClibc issue with reading boot_id in the absense of a system MAC address. --- uuid.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/uuid.c b/uuid.c index 4144308..41b089d 100644 --- a/uuid.c +++ b/uuid.c @@ -42,7 +42,7 @@ monotonic_us(void) } int -read_bootid_node(u_int8_t *buf, size_t size) +read_bootid_node(unsigned char *buf, size_t size) { FILE *boot_id; @@ -53,9 +53,8 @@ read_bootid_node(u_int8_t *buf, size_t size) if(!boot_id) return -1; if((fseek(boot_id, 24, SEEK_SET) < 0) || - (fscanf(boot_id, "%02x%02x%02x%02x%02x%02x", - (unsigned *)&buf[0], (unsigned *)&buf[1], (unsigned *)&buf[2], - (unsigned *)&buf[3], (unsigned *)&buf[4], (unsigned *)&buf[5]) != 6)) + (fscanf(boot_id, "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx", + &buf[0], &buf[1], &buf[2], &buf[3], &buf[4], &buf[5]) != 6)) { fclose(boot_id); return -1;