diff options
author | Anton Lundin <glance@acc.umu.se> | 2015-04-29 23:47:56 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-04-29 14:53:03 -0700 |
commit | c38b7d3922b8ec11625bbd423047a01baf533b14 (patch) | |
tree | 57d4ed255c1d3226cf11cef62bf4e4e6c0f87fe9 | |
parent | a4c35f1d6385089b69c4cc3f5b1823c7234ca1c7 (diff) | |
download | subsurface-c38b7d3922b8ec11625bbd423047a01baf533b14.tar.gz |
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 <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | libdivecomputer.c | 3 |
1 files changed, 3 insertions, 0 deletions
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."); |