X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi_serial.c;h=02242ef66b5dc86d36502e6b352e9e6b5b1079b1;hb=055804e89ea0f6b4145040a0eeb2f4e6951692fe;hp=096a77c1e74fefe823523dafd950496883f6c366;hpb=66836720f73c12fb107aa28b79cc6420c721cc5d;p=libsigrok.git diff --git a/src/scpi/scpi_serial.c b/src/scpi/scpi_serial.c index 096a77c1..02242ef6 100644 --- a/src/scpi/scpi_serial.c +++ b/src/scpi/scpi_serial.c @@ -123,26 +123,21 @@ static int scpi_serial_source_remove(struct sr_session *session, void *priv) static int scpi_serial_send(void *priv, const char *command) { int len, result, written; - gchar *terminated_command; struct scpi_serial *sscpi = priv; struct sr_serial_dev_inst *serial = sscpi->serial; - terminated_command = g_strconcat(command, "\n", NULL); - len = strlen(terminated_command); + len = strlen(command); written = 0; while (written < len) { result = serial_write_nonblocking(serial, - terminated_command + written, len - written); + command + written, len - written); if (result < 0) { sr_err("Error while sending SCPI command: '%s'.", command); - g_free(terminated_command); return SR_ERR; } written += result; } - g_free(terminated_command); - sr_spew("Successfully sent SCPI command: '%s'.", command); return SR_OK;