X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi_vxi.c;h=9f6b2c356ea1444ce4def493014fca4766e1ef0d;hb=055804e89ea0f6b4145040a0eeb2f4e6951692fe;hp=8a99ec7474b3e5cee740f9e6367e0faa4651d315;hpb=2c24077466a299ead689c90f01f55f6d86c7386b;p=libsigrok.git diff --git a/src/scpi/scpi_vxi.c b/src/scpi/scpi_vxi.c index 8a99ec74..9f6b2c35 100644 --- a/src/scpi/scpi_vxi.c +++ b/src/scpi/scpi_vxi.c @@ -118,18 +118,16 @@ static int scpi_vxi_send(void *priv, const char *command) struct scpi_vxi *vxi = priv; Device_WriteResp *write_resp; Device_WriteParms write_parms; - char *terminated_command; unsigned long len; - terminated_command = g_strdup_printf("%s\r\n", command); - len = strlen(terminated_command); + len = strlen(command); write_parms.lid = vxi->link; write_parms.io_timeout = VXI_DEFAULT_TIMEOUT_MS; write_parms.lock_timeout = VXI_DEFAULT_TIMEOUT_MS; write_parms.flags = DF_END; write_parms.data.data_len = MIN(len, vxi->max_send_size); - write_parms.data.data_val = terminated_command; + write_parms.data.data_val = command; if (!(write_resp = device_write_1(&write_parms, vxi->client)) || write_resp->error) { @@ -138,8 +136,6 @@ static int scpi_vxi_send(void *priv, const char *command) return SR_ERR; } - g_free(terminated_command); - if (write_resp->size < len) sr_dbg("Only sent %lu/%lu bytes of SCPI command: '%s'.", write_resp->size, len, command);