mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make sure we always have copies of equipment descriptions
Having pointers copied around that might get freed elsewhere could be a problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1055b5afd3
commit
8d766e13e2
4 changed files with 13 additions and 5 deletions
|
|
@ -23,7 +23,7 @@ void add_cylinder_description(cylinder_type_t *type)
|
|||
return;
|
||||
}
|
||||
if (i < 100) {
|
||||
tank_info[i].name = desc;
|
||||
tank_info[i].name = strdup(desc);
|
||||
tank_info[i].ml = type->size.mliter;
|
||||
tank_info[i].bar = type->workingpressure.mbar / 1000;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ void add_weightsystem_description(weightsystem_t *weightsystem)
|
|||
}
|
||||
}
|
||||
if (i < 100) {
|
||||
ws_info[i].name = desc;
|
||||
ws_info[i].name = strdup(desc);
|
||||
ws_info[i].grams = weightsystem->weight.grams;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue