X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi_visa.c;h=a8f50e4f65c71fde5451d19032e80a78e610d0e8;hb=12f62ce62094500250062c4d0d0b78deeb303ec9;hp=220ead4fd3e31db1a568ddeb62240cb69db960cd;hpb=04229f7bfc750f2b67e8dd54ac82ae6bb7eae1e4;p=libsigrok.git diff --git a/src/scpi/scpi_visa.c b/src/scpi/scpi_visa.c index 220ead4f..a8f50e4f 100644 --- a/src/scpi/scpi_visa.c +++ b/src/scpi/scpi_visa.c @@ -87,21 +87,16 @@ static int scpi_visa_source_remove(struct sr_session *session, void *priv) static int scpi_visa_send(void *priv, const char *command) { struct scpi_visa *vscpi = priv; - gchar *terminated_command; ViUInt32 written = 0; int len; - terminated_command = g_strconcat(command, "\n", NULL); - len = strlen(terminated_command); - if (viWrite(vscpi->vi, (ViBuf) (terminated_command + written), len, + len = strlen(command); + if (viWrite(vscpi->vi, (ViBuf) (command + written), len, &written) != VI_SUCCESS) { sr_err("Error while sending SCPI command: '%s'.", command); - g_free(terminated_command); return SR_ERR; } - g_free(terminated_command); - sr_spew("Successfully sent SCPI command: '%s'.", command); return SR_OK;