Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwsetup-ng.git;a=commitdiff;h=0f2249cb1210059817195ad5b568ab55b047d0ff

commit 0f2249cb1210059817195ad5b568ab55b047d0ff
Author: James Buren <[email protected]>
Date:   Tue Aug 14 14:58:03 2012 -0500

drop a union and just use regular variables in partition struct

diff --git a/fwsetup.h b/fwsetup.h
index 9af3288..af0220e 100644
--- a/fwsetup.h
+++ b/fwsetup.h
@@ -94,11 +94,8 @@ struct partition
unsigned long long start;
unsigned long long end;
unsigned long long sectors;
-  union
-  {
-    unsigned char type_n;
-    char *type_s;
-  };
+  unsigned char type_n;
+  char *type_s;
unsigned long long flags;
bool primary;
bool extended;
diff --git a/utility.c b/utility.c
index 1911157..7ed0217 100644
--- a/utility.c
+++ b/utility.c
@@ -406,10 +406,9 @@ extern struct device *read_device_data(const char *path)

partitions->sectors = partsize;

-            if(strcmp(label,"dos") == 0)
-              partitions->type_n = parttype_n;
-            else if(strcmp(label,"gpt") == 0)
-              partitions->type_s = strdup(parttype_s);
+            partitions->type_n = parttype_n;
+
+            partitions->type_s = (parttype_s != 0) ? strdup(parttype_s) : 0;

partitions->flags = partflags;

@@ -541,6 +540,8 @@ extern void free_device(struct device *device)
if(device == 0)
return;

+  free(device->uuid);
+
free(device->label);

free(device->path);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to