Replace a DIY length calculation with a glib call.
* model, serial number of the instrument and the firmware version.
*/
tokens = g_strsplit(response, ",", 0);
* model, serial number of the instrument and the firmware version.
*/
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);
if (num_tokens < 4) {
sr_dbg("IDN response not according to spec: %80.s.", response);
g_strfreev(tokens);