summaryrefslogtreecommitdiff
path: root/sshbuf-getput-basic.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2016-07-15 14:48:30 +1000
committerDarren Tucker <dtucker@zip.com.au>2016-07-15 14:54:16 +1000
commit5abfb15ced985c340359ae7fb65a625ed3692b3e (patch)
treebcde17550f213403000237c99a541ec43cae38b1 /sshbuf-getput-basic.c
parent832b7443b7a8e181c95898bc5d73497b7190decd (diff)
Move VA_COPY macro into compat header.
Some AIX compilers unconditionally undefine va_copy but don't set it back to an internal function, causing link errors. In some compat code we already use VA_COPY instead so move the two existing instances into the shared header and use for sshbuf-getput-basic.c too. Should fix building with at lease some versions of AIX's compiler. bz#2589, ok djm@
Diffstat (limited to 'sshbuf-getput-basic.c')
-rw-r--r--sshbuf-getput-basic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sshbuf-getput-basic.c b/sshbuf-getput-basic.c
index ad21ae574..74c49be7c 100644
--- a/sshbuf-getput-basic.c
+++ b/sshbuf-getput-basic.c
@@ -270,7 +270,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap)
270 int r, len; 270 int r, len;
271 u_char *p; 271 u_char *p;
272 272
273 va_copy(ap2, ap); 273 VA_COPY(ap2, ap);
274 if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) { 274 if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) {
275 r = SSH_ERR_INVALID_ARGUMENT; 275 r = SSH_ERR_INVALID_ARGUMENT;
276 goto out; 276 goto out;
@@ -280,7 +280,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap)
280 goto out; /* Nothing to do */ 280 goto out; /* Nothing to do */
281 } 281 }
282 va_end(ap2); 282 va_end(ap2);
283 va_copy(ap2, ap); 283 VA_COPY(ap2, ap);
284 if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0) 284 if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0)
285 goto out; 285 goto out;
286 if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) { 286 if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) {