diff options
-rw-r--r-- | utf8.c | 16 | ||||
-rw-r--r-- | utf8.h | 4 |
2 files changed, 18 insertions, 2 deletions
@@ -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 | ||
258 | int | ||
259 | asmprintf(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. |
@@ -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 *, ...) | |||
22 | int vfmprintf(FILE *, const char *, va_list); | 22 | int vfmprintf(FILE *, const char *, va_list); |
23 | int snmprintf(char *, size_t, int *, const char *, ...) | 23 | int snmprintf(char *, size_t, int *, const char *, ...) |
24 | __attribute__((format(printf, 4, 5))); | 24 | __attribute__((format(printf, 4, 5))); |
25 | int asmprintf(char **, size_t, int *, const char *, ...) | ||
26 | __attribute__((format(printf, 4, 5))); | ||
25 | void msetlocale(void); | 27 | void msetlocale(void); |