summaryrefslogtreecommitdiff
path: root/cgpt/cgpt_edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgpt/cgpt_edit.c')
-rw-r--r--cgpt/cgpt_edit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgpt/cgpt_edit.c b/cgpt/cgpt_edit.c
index 098187f6..622819b7 100644
--- a/cgpt/cgpt_edit.c
+++ b/cgpt/cgpt_edit.c
@@ -30,7 +30,9 @@ int CgptEdit(CgptEditParams *params) {
}
h = (GptHeader *)drive.gpt.primary_header;
- memcpy(&h->disk_uuid, &params->unique_guid, sizeof(h->disk_uuid));
+ if (params->set_unique) {
+ memcpy(&h->disk_uuid, &params->unique_guid, sizeof(h->disk_uuid));
+ }
// Copy to secondary
RepairHeader(&drive.gpt, MASK_PRIMARY);
drive.gpt.modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_HEADER2);