X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsiglent-sds%2Fprotocol.c;h=919df9b27c30830ff16ff3f41c73b918abebc1a5;hb=29bd62ff51b33f2042310b3117a8035a64232cae;hp=fde58d003e524e1f52b7ab596cf6e5b2b4649b51;hpb=70158398f3446881eee8493e8f6d2599f26a1c18;p=libsigrok.git diff --git a/src/hardware/siglent-sds/protocol.c b/src/hardware/siglent-sds/protocol.c index fde58d00..919df9b2 100644 --- a/src/hardware/siglent-sds/protocol.c +++ b/src/hardware/siglent-sds/protocol.c @@ -782,7 +782,7 @@ SR_PRIV int siglent_sds_get_dev_cfg(const struct sr_dev_inst *sdi) if (sr_scpi_get_string(sdi->conn, "TRSE?", &response) != SR_OK) return SR_ERR; tokens = g_strsplit(response, ",", 0); - for (num_tokens = 0; tokens[num_tokens] != NULL; num_tokens++); + num_tokens = g_strv_length(tokens); if (num_tokens < 4) { sr_dbg("IDN response not according to spec: %80.s.", response); g_strfreev(tokens);