From: Bert Vermeulen Date: Mon, 17 Aug 2015 00:02:03 +0000 (+0200) Subject: scpi: Strip leading/trailing spaces from *IDN? response. X-Git-Tag: libsigrok-0.4.0~394 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=558d438d1f944284be13bec06db7ca67876ea234;p=libsigrok.git scpi: Strip leading/trailing spaces from *IDN? response. --- diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index 2ec22ad5..38d74ab5 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -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);