From: Karel Zak Date: Wed, 25 Jul 2007 14:55:25 +0000 (+0200) Subject: mkswap: fix signedness problems and remove obsolete code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f88c89db4fe96d0de7e889c3d1a6ea770bc3eaa3;p=util-linux mkswap: fix signedness problems and remove obsolete code The UUID is unsigned char * Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index fdd3e0d7..1fd1f185 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -195,28 +195,8 @@ write_signature(char *sig) { strncpy(sp+pagesize-10, sig, 10); } -#if 0 -static int -tohex(int a) { - return ((a < 10) ? '0'+a : 'a'+a-10); -} - -static void -uuid_unparse(unsigned char *uuid, char *s) { - int i; - - for (i=0; i<16; i++) { - if (i == 4 || i == 6 || i == 8 || i == 10) - *s++ = '-'; - *s++ = tohex((uuid[i] >> 4) & 0xf); - *s++ = tohex(uuid[i] & 0xf); - } - *s = 0; -} -#endif - static void -write_uuid_and_label(char *uuid, char *volume_name) { +write_uuid_and_label(unsigned char *uuid, char *volume_name) { struct swap_header_v1_2 *h; /* Sanity check */ @@ -520,7 +500,7 @@ main(int argc, char ** argv) { char *block_count = 0; char *pp; char *opt_label = NULL; - char *uuid = NULL; + unsigned char *uuid = NULL; #ifdef HAVE_LIBUUID uuid_t uuid_dat; #endif