diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-06-19 04:02:02 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-06-20 09:30:58 +0900 |
commit | 9e58e6f0e6bbddc245b119a6f067ff219d445193 (patch) | |
tree | 1f4608cd856d286fb2f7a5d84cc9632bb5324b1c /core | |
parent | 06a870c232513aca96a624535d648a6e7c098e5f (diff) | |
download | subsurface-9e58e6f0e6bbddc245b119a6f067ff219d445193.tar.gz |
equipment: use MAX_TANK_INFO in equipment.c
MAX_TANK_INFO is defined in dive.h but is not
used in add_cylinder_description() or when
allocating 'tank_info'.
Use MAX_TANK_INFO instead of the literal 100.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/equipment.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/equipment.c b/core/equipment.c index 0df62e332..53e4c273f 100644 --- a/core/equipment.c +++ b/core/equipment.c @@ -24,11 +24,11 @@ void add_cylinder_description(cylinder_type_t *type) desc = type->description; if (!desc) return; - for (i = 0; i < 100 && tank_info[i].name != NULL; i++) { + for (i = 0; i < MAX_TANK_INFO && tank_info[i].name != NULL; i++) { if (strcmp(tank_info[i].name, desc) == 0) return; } - if (i < 100) { + if (i < MAX_TANK_INFO) { // FIXME: leaked on exit tank_info[i].name = strdup(desc); tank_info[i].ml = type->size.mliter; @@ -120,7 +120,7 @@ bool no_weightsystems(weightsystem_t *ws) * we should pick up any other names from the dive * logs directly. */ -struct tank_info_t tank_info[100] = { +struct tank_info_t tank_info[MAX_TANK_INFO] = { /* Need an empty entry for the no-cylinder case */ { "", }, |