aboutsummaryrefslogtreecommitdiffstats
path: root/core/libdivecomputer.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/libdivecomputer.c')
-rw-r--r--core/libdivecomputer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 70b747114..75cb0ce4c 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -175,25 +175,25 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
* for cuft sizes (as that's all that you can enter) */
dive->cylinder[i].type.workingpressure.mbar = lrint(
dive->cylinder[i].type.workingpressure.mbar * 206.843 / 206.7 );
- char name_buffer[9];
+ char name_buffer[17];
int rounded_size = lrint(ml_to_cuft(gas_volume(&dive->cylinder[i],
dive->cylinder[i].type.workingpressure)));
rounded_size = (int)((rounded_size + 5) / 10) * 10;
switch (dive->cylinder[i].type.workingpressure.mbar) {
case 206843:
- snprintf(name_buffer, 9, "AL%d", rounded_size);
+ snprintf(name_buffer, sizeof(name_buffer), "AL%d", rounded_size);
break;
case 234422: /* this is wrong - HP tanks tend to be 3440, but Suunto only allows 3400 */
- snprintf(name_buffer, 9, "HP%d", rounded_size);
+ snprintf(name_buffer, sizeof(name_buffer), "HP%d", rounded_size);
break;
case 179263:
- snprintf(name_buffer, 9, "LP+%d", rounded_size);
+ snprintf(name_buffer, sizeof(name_buffer), "LP+%d", rounded_size);
break;
case 165474:
- snprintf(name_buffer, 9, "LP%d", rounded_size);
+ snprintf(name_buffer, sizeof(name_buffer), "LP%d", rounded_size);
break;
default:
- snprintf(name_buffer, 9, "%d cuft", rounded_size);
+ snprintf(name_buffer, sizeof(name_buffer), "%d cuft", rounded_size);
break;
}
dive->cylinder[i].type.description = copy_string(name_buffer);