View | Details | Raw Unified | Return to bug 2589
Collapse All | Expand All

(-)a/openbsd-compat/bsd-asprintf.c (-12 lines)
Lines 25-42 Link Here
25
#include <stdarg.h>
25
#include <stdarg.h>
26
#include <stdlib.h>
26
#include <stdlib.h>
27
27
28
#ifndef VA_COPY
29
# ifdef HAVE_VA_COPY
30
#  define VA_COPY(dest, src) va_copy(dest, src)
31
# else
32
#  ifdef HAVE___VA_COPY
33
#   define VA_COPY(dest, src) __va_copy(dest, src)
34
#  else
35
#   define VA_COPY(dest, src) (dest) = (src)
36
#  endif
37
# endif
38
#endif
39
40
#define INIT_SZ	128
28
#define INIT_SZ	128
41
29
42
int
30
int
(-)a/openbsd-compat/bsd-snprintf.c (-12 lines)
Lines 99-116 Link Here
99
# undef HAVE_VSNPRINTF
99
# undef HAVE_VSNPRINTF
100
#endif
100
#endif
101
101
102
#ifndef VA_COPY
103
# ifdef HAVE_VA_COPY
104
#  define VA_COPY(dest, src) va_copy(dest, src)
105
# else
106
#  ifdef HAVE___VA_COPY
107
#   define VA_COPY(dest, src) __va_copy(dest, src)
108
#  else
109
#   define VA_COPY(dest, src) (dest) = (src)
110
#  endif
111
# endif
112
#endif
113
114
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
102
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
115
103
116
#include <ctype.h>
104
#include <ctype.h>
(-)a/openbsd-compat/openbsd-compat.h (+17 lines)
Lines 235-240 long long strtonum(const char *, long long, long long, const char **); Link Here
235
# include <stdarg.h>
235
# include <stdarg.h>
236
#endif
236
#endif
237
237
238
/*
239
 * Some platforms unconditionally undefine va_copy() so we define VA_COPY()
240
 * instead.  This is known to be the case on at least some configurations of
241
 * AIX with the xlc compiler.
242
 */
243
#ifndef VA_COPY
244
# ifdef HAVE_VA_COPY
245
#  define VA_COPY(dest, src) va_copy(dest, src)
246
# else
247
#  ifdef HAVE___VA_COPY
248
#   define VA_COPY(dest, src) __va_copy(dest, src)
249
#  else
250
#   define VA_COPY(dest, src) (dest) = (src)
251
#  endif
252
# endif
253
#endif
254
238
#ifndef HAVE_VASPRINTF
255
#ifndef HAVE_VASPRINTF
239
int vasprintf(char **, const char *, va_list);
256
int vasprintf(char **, const char *, va_list);
240
#endif
257
#endif
(-)a/sshbuf-getput-basic.c (-2 / +2 lines)
Lines 268-274 sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap) Link Here
268
	int r, len;
268
	int r, len;
269
	u_char *p;
269
	u_char *p;
270
270
271
	va_copy(ap2, ap);
271
	VA_COPY(ap2, ap);
272
	if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) {
272
	if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) {
273
		r = SSH_ERR_INVALID_ARGUMENT;
273
		r = SSH_ERR_INVALID_ARGUMENT;
274
		goto out;
274
		goto out;
Lines 278-284 sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap) Link Here
278
		goto out; /* Nothing to do */
278
		goto out; /* Nothing to do */
279
	}
279
	}
280
	va_end(ap2);
280
	va_end(ap2);
281
	va_copy(ap2, ap);
281
	VA_COPY(ap2, ap);
282
	if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0)
282
	if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0)
283
		goto out;
283
		goto out;
284
	if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) {
284
	if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) {

Return to bug 2589