diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2012-10-02 17:56:12 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-10-02 09:27:14 -0700 |
commit | f2adb0cea638c6eeecc59e6879371a2409547ced (patch) | |
tree | e6fb6a925e3914914e4a6450f3d61bbac35f313d /dive.c | |
parent | fa5afc697e664a93fc754e50dbfd15b2333028e7 (diff) | |
download | subsurface-f2adb0cea638c6eeecc59e6879371a2409547ced.tar.gz |
fixup_dive(): move the add_* calls before a possible return
In dive.c:fixup_dive() it would be better to call functions
like add_people() and add_location() before the possible return
in the "if (end < 0)" branch.
This prevents a partial auto-complete list in "Dive Info"
combo boxes.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -384,6 +384,10 @@ struct dive *fixup_dive(struct dive *dive) int lasttemp = 0, lastpressure = 0; int pressure_delta[MAX_CYLINDERS] = {INT_MAX, }; + add_people(dive->buddy); + add_people(dive->divemaster); + add_location(dive->location); + add_suit(dive->suit); sanitize_cylinder_info(dive); for (i = 0; i < dive->samples; i++) { struct sample *sample = dive->sample + i; @@ -496,10 +500,6 @@ struct dive *fixup_dive(struct dive *dive) update_temperature(&dive->watertemp, mintemp); update_depth(&dive->maxdepth, maxdepth); - add_people(dive->buddy); - add_people(dive->divemaster); - add_location(dive->location); - add_suit(dive->suit); for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = dive->cylinder + i; add_cylinder_description(&cyl->type); |