summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utf8.c16
-rw-r--r--utf8.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index b3d300478..f83401996 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: utf8.c,v 1.9 2020/03/06 18:12:55 markus Exp $ */ 1/* $OpenBSD: utf8.c,v 1.10 2020/04/03 02:25:21 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 3 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4 * 4 *
@@ -255,6 +255,20 @@ snmprintf(char *str, size_t sz, int *wp, const char *fmt, ...)
255 return ret; 255 return ret;
256} 256}
257 257
258int
259asmprintf(char **outp, size_t sz, int *wp, const char *fmt, ...)
260{
261 va_list ap;
262 int ret;
263
264 *outp = NULL;
265 va_start(ap, fmt);
266 ret = vasnmprintf(outp, sz, wp, fmt, ap);
267 va_end(ap);
268
269 return ret;
270}
271
258/* 272/*
259 * To stay close to the standard interfaces, the following functions 273 * To stay close to the standard interfaces, the following functions
260 * return the number of non-NUL bytes written. 274 * return the number of non-NUL bytes written.
diff --git a/utf8.h b/utf8.h
index 88c5a34a3..20a11dc59 100644
--- a/utf8.h
+++ b/utf8.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: utf8.h,v 1.1 2016/05/25 23:48:45 schwarze Exp $ */ 1/* $OpenBSD: utf8.h,v 1.2 2020/04/03 02:25:21 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 3 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4 * 4 *
@@ -22,4 +22,6 @@ int fmprintf(FILE *, const char *, ...)
22int vfmprintf(FILE *, const char *, va_list); 22int vfmprintf(FILE *, const char *, va_list);
23int snmprintf(char *, size_t, int *, const char *, ...) 23int snmprintf(char *, size_t, int *, const char *, ...)
24 __attribute__((format(printf, 4, 5))); 24 __attribute__((format(printf, 4, 5)));
25int asmprintf(char **, size_t, int *, const char *, ...)
26 __attribute__((format(printf, 4, 5)));
25void msetlocale(void); 27void msetlocale(void);