From: Aurelien Jacobs Date: Sun, 20 Sep 2015 14:15:01 +0000 (+0200) Subject: scpi: scpi_cmd_resp() shouldn't return SR_OK without filling the gvar X-Git-Tag: libsigrok-0.4.0~276 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=06f63a749ea15ae88e8183404a0d6e3d1fd85de3;p=libsigrok.git scpi: scpi_cmd_resp() shouldn't return SR_OK without filling the gvar scpi-pps at line 212 assumes that an SR_OK return means that the gvar is valid, which leads to the following error: ** GLib:ERROR:/build/glib2.0-2.45.8/./glib/gvarianttypeinfo.c:184:g_variant_type_info_check: assertion failed: (0 <= index && index < 24) --- diff --git a/src/scpi/helpers.c b/src/scpi/helpers.c index 9efa10c5..c686390f 100644 --- a/src/scpi/helpers.c +++ b/src/scpi/helpers.c @@ -97,8 +97,8 @@ SR_PRIV int scpi_cmd_resp(const struct sr_dev_inst *sdi, const struct scpi_comma const char *cmd; if (!(cmd = scpi_cmd_get(cmdtable, command))) { - /* Device does not implement this command, that's OK. */ - return SR_OK; + /* Device does not implement this command. */ + return SR_ERR_NA; } scpi = sdi->conn;