1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-11 20:29:24 +00:00

Petite optimisation

This commit is contained in:
2018-06-06 20:33:34 +02:00
parent 8ed34b4593
commit 027f2bcc15
2 changed files with 2 additions and 5 deletions

View File

@ -17,8 +17,7 @@ void _free__Resident(THIS(Resident)){
Resident *_init_Resident(int id, char* name, int apartment_floor){
Resident * new_resident = malloc_or_die(sizeof(Resident));
new_resident->name = malloc_or_die(sizeof(char) * strlen(name));
strcpy(new_resident->name, name);
new_resident->name = strdup(name);
new_resident->id = id;
new_resident->apartment_floor = apartment_floor;
new_resident->position = new_resident->apartment_floor;