For dos partitions of type 0, output 0x00, not 0x0
authorDavid Zeuthen <davidz@redhat.com>
Wed, 9 Nov 2011 18:35:13 +0000 (13:35 -0500)
committerDavid Zeuthen <davidz@redhat.com>
Wed, 9 Nov 2011 18:35:13 +0000 (13:35 -0500)
Signed-off-by: David Zeuthen <davidz@redhat.com>
src/udiskslinuxpartition.c

index 4058c6a..e6f535e 100644 (file)
@@ -151,7 +151,7 @@ udisks_linux_partition_update (UDisksLinuxPartition  *partition,
         {
           char *endp;
           gint type_as_int = strtol (type, &endp, 0);
-          if (type_as_int > 0 && *endp == '\0')
+          if (type[0] != '\0' && *endp == '\0')
             {
               /* ensure 'dos' partition types are always of the form 0x0c (e.g. with two digits) */
               snprintf (type_buf, sizeof type_buf, "0x%02x", type_as_int);