Skip to content

Commit 023b678

Browse files
authored
Merge pull request #821 from AKuHAK/renamefix
Fix apaRename function to properly clear and copy newId to header
2 parents b68d105 + e94c67e commit 023b678

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

iop/hdd/apa/src/hdd_fio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ static int apaRename(s32 device, const char *oldId, const char *newId)
559559
}
560560

561561
// do the renaming :) note: subs have no names!!
562-
memcpy(clink->header->id, newId, APA_IDMAX);
562+
memset(clink->header->id, 0, APA_IDMAX);
563+
strncpy(clink->header->id, newId, APA_IDMAX - 1);
563564

564565
// touch creation time
565566
apaGetTime(&clink->header->created);

0 commit comments

Comments
 (0)