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 <gla...@acc.umu.se>
---
 libdivecomputer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libdivecomputer.c b/libdivecomputer.c
index 069e87b..f07023f 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.");
-- 
2.1.4

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to