scpi: Strip trailing newlines in sr_scpi_get_string().
This commit is contained in:
parent
470140fc0d
commit
d03dfac6b9
|
@ -312,6 +312,10 @@ SR_PRIV int sr_scpi_get_string(struct sr_scpi_dev_inst *scpi,
|
|||
g_string_append_len(response, buf, len);
|
||||
}
|
||||
|
||||
/* Get rid of trailing linefeed if present */
|
||||
if (response->len >= 1 && response->str[response->len - 1] == '\n')
|
||||
g_string_truncate(response, response->len - 1);
|
||||
|
||||
*scpi_response = response->str;
|
||||
g_string_free(response, FALSE);
|
||||
|
||||
|
|
Loading…
Reference in New Issue