]> err.no Git - util-linux/commitdiff
mkswap: fix signedness problems and remove obsolete code
authorKarel Zak <kzak@redhat.com>
Wed, 25 Jul 2007 14:55:25 +0000 (16:55 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 25 Jul 2007 15:18:57 +0000 (17:18 +0200)
The UUID is unsigned char *

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c

index fdd3e0d7a9f013b37031ed57f7db637953811c64..1fd1f185bd040971fc44a26b62ee907222dd99e2 100644 (file)
@@ -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