]> sigrok.org Git - libsigrok.git/blobdiff - src/scpi/scpi_visa.c
scpi: Rephrase buffer resize for free space during SCPI read, add comments
[libsigrok.git] / src / scpi / scpi_visa.c
index 220ead4fd3e31db1a568ddeb62240cb69db960cd..a8f50e4f65c71fde5451d19032e80a78e610d0e8 100644 (file)
@@ -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;