]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Eliminate fixed-size buffer in set_cfg.
authorMartin Ling <redacted>
Wed, 4 Dec 2013 10:55:32 +0000 (10:55 +0000)
committerMartin Ling <redacted>
Wed, 4 Dec 2013 10:56:09 +0000 (10:56 +0000)
hardware/rigol-ds/api.c

index 370d1f72369656e7fc6b75fa809642f674244d84..e578d5b9faf20416ca48976e7994003e35f26e34 100644 (file)
@@ -192,12 +192,13 @@ static int dev_clear(void)
 static int set_cfg(const struct sr_dev_inst *sdi, const char *format, ...)
 {
        va_list args;
-       char buf[256];
+       int ret;
 
        va_start(args, format);
-       vsnprintf(buf, 255, format, args);
+       ret = sr_scpi_send_variadic(sdi->conn, format, args);
        va_end(args);
-       if (sr_scpi_send(sdi->conn, buf) != SR_OK)
+
+       if (ret != SR_OK)
                return SR_ERR;
 
        /* When setting a bunch of parameters in a row, the DS1052E scrambles