From: Ralf Date: Tue, 20 Oct 2020 18:19:03 +0000 (+0200) Subject: rigol-dg: Handle unknown waveform types and abort gracefully X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=96791eadccbf03ea7f04be11be62ae73a21ab08e;p=libsigrok.git rigol-dg: Handle unknown waveform types and abort gracefully --- diff --git a/src/hardware/rigol-dg/protocol.c b/src/hardware/rigol-dg/protocol.c index 47bf9446..0398135e 100644 --- a/src/hardware/rigol-dg/protocol.c +++ b/src/hardware/rigol-dg/protocol.c @@ -122,8 +122,11 @@ SR_PRIV int rigol_dg_get_channel_state(const struct sr_dev_inst *sdi, wf = WF_ARB; else if (g_ascii_strncasecmp(s, "DC", strlen("DC")) == 0) wf = WF_DC; - else + else { + sr_warn("Unknown waveform: %s\n", s); + ret = SR_ERR; goto done; + } ch_status->wf = wf; ch_status->wf_spec = rigol_dg_get_waveform_spec( &devc->device->channels[ch->index], wf);