From c38b7d3922b8ec11625bbd423047a01baf533b14 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 29 Apr 2015 23:47:56 +0200 Subject: Add a default case for switch over dc_family_t This adds a default case which just errors out for the switch over dc_family_t instead of checking a uninitialized variable if this was ever called with something else than one of the expected dc-family types. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- libdivecomputer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libdivecomputer.c b/libdivecomputer.c index 069e87bd4..f07023f88 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -963,6 +963,9 @@ dc_status_t libdc_buffer_parser(struct dive *dive, device_data_t *data, unsigned case DC_FAMILY_HW_OSTC3: rc = hw_ostc_parser_create (&parser, data->context, data->deviceid, 1); break; + default: + report_error("Device type not handled!"); + return DC_STATUS_UNSUPPORTED; } if (rc != DC_STATUS_SUCCESS) { report_error("Error creating parser."); -- cgit v1.2.3-70-g09d2