From 84073e32ef34d0ed4b7f6ea4ec0cd06e9cc49b96 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Sun, 16 May 2021 14:57:54 +0200 Subject: [PATCH] siglent-sds: prefer common glib routine to get vector's length Replace an open coded loop with a call to common glib code. --- src/hardware/siglent-sds/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2