From 4d7a9a14a3cfeb4cba2a9996ac1e11d9cecf70fa Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Wed, 4 Dec 2013 10:55:32 +0000 Subject: [PATCH] rigol-ds: Eliminate fixed-size buffer in set_cfg. --- hardware/rigol-ds/api.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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