]> sigrok.org Git - libsigrok.git/commitdiff
scpi: Strip leading/trailing spaces from *IDN? response.
authorBert Vermeulen <redacted>
Mon, 17 Aug 2015 00:02:03 +0000 (02:02 +0200)
committerUwe Hermann <redacted>
Tue, 25 Aug 2015 17:13:17 +0000 (19:13 +0200)
src/scpi/scpi.c

index 2ec22ad51f0dc7fa69364b8262009211a95ea4b4..38d74ab5ffcc17989d478e9a9cb93fcf3c9877a0 100644 (file)
@@ -745,10 +745,10 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
        g_free(response);
 
        hw_info = g_malloc0(sizeof(struct sr_scpi_hw_info));
-       hw_info->manufacturer = g_strdup(tokens[0]);
-       hw_info->model = g_strdup(tokens[1]);
-       hw_info->serial_number = g_strdup(tokens[2]);
-       hw_info->firmware_version = g_strdup(tokens[3]);
+       hw_info->manufacturer = g_strstrip(g_strdup(tokens[0]));
+       hw_info->model = g_strstrip(g_strdup(tokens[1]));
+       hw_info->serial_number = g_strstrip(g_strdup(tokens[2]));
+       hw_info->firmware_version = g_strstrip(g_strdup(tokens[3]));
 
        g_strfreev(tokens);