scpi: Strip leading/trailing spaces from *IDN? response.

This commit is contained in:
Bert Vermeulen 2015-08-17 02:02:03 +02:00 committed by Uwe Hermann
parent c0d257790a
commit 558d438d1f
1 changed files with 4 additions and 4 deletions

View 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);