From: Martin Ling Date: Wed, 4 Dec 2013 10:55:32 +0000 (+0000) Subject: rigol-ds: Eliminate fixed-size buffer in set_cfg. X-Git-Tag: libsigrok-0.3.0~489 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4d7a9a14a3cfeb4cba2a9996ac1e11d9cecf70fa;p=libsigrok.git rigol-ds: Eliminate fixed-size buffer in set_cfg. --- diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index 370d1f72..e578d5b9 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -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