]> sigrok.org Git - libsigrok.git/commitdiff
agilent-dmm: Code cleanup.
authorBert Vermeulen <redacted>
Thu, 2 Oct 2014 12:11:35 +0000 (14:11 +0200)
committerBert Vermeulen <redacted>
Thu, 2 Oct 2014 12:11:35 +0000 (14:11 +0200)
This cleans up a warning generated by clang's static analyzer.

src/hardware/agilent-dmm/sched.c

index 66cb60a2b5eaa59efb9239b0d83209cd5458ceca..df65113407b2713a650e3fc57e8696b71a2169ba 100644 (file)
@@ -137,9 +137,9 @@ static int agdmm_send(const struct sr_dev_inst *sdi, const char *cmd)
        sr_spew("Sending '%s'.", cmd);
        strncpy(buf, cmd, 28);
        if (!strncmp(buf, "*IDN?", 5))
-               strncat(buf, "\r\n", 32);
+               strcat(buf, "\r\n");
        else
-               strncat(buf, "\n\r\n", 32);
+               strcat(buf, "\n\r\n");
        if (serial_write_blocking(serial, buf, strlen(buf)) == -1) {
                sr_err("Failed to send: %s.", strerror(errno));
                return SR_ERR;