X-Git-Url: https://git.lttng.org/?p=ust.git;a=blobdiff_plain;f=snprintf%2Fvfprintf.c;h=1b8fba6721a8d1af6ed806959c1f2daf11c5d8e3;hp=4fc86bf08d8ded480ae73558f77e8fe8e2792a51;hb=HEAD;hpb=bf0d695d692163edb23b8fbbbd976387dfef232d diff --git a/snprintf/vfprintf.c b/snprintf/vfprintf.c index 4fc86bf..1b8fba6 100644 --- a/snprintf/vfprintf.c +++ b/snprintf/vfprintf.c @@ -239,7 +239,7 @@ int ust_safe_vfprintf(LFILE *fp, const char *fmt0, va_list ap) int dprec; /* a copy of prec if %[diouxX], 0 otherwise */ int realsz; /* field size expanded by dprec */ int size; /* size of converted field or string */ - const char *xdigs; /* digits for %[xX] conversion */ + const char *xdigs = NULL; /* digits for %[xX] conversion */ #define NIOV 8 struct __suio uio; /* output information: summary */ struct __siov iov[NIOV];/* ... and individual io vectors */ @@ -399,7 +399,7 @@ int ust_safe_vfprintf(LFILE *fp, const char *fmt0, va_list ap) */ for (;;) { cp = fmt; - while ((n = mbrtowc(&wc, fmt, MB_CUR_MAX, &ps)) > 0) { + while ((n = ust_safe_mbrtowc(&wc, fmt, MB_CUR_MAX, &ps)) > 0) { fmt += n; if (wc == '%') { fmt--; @@ -1071,7 +1071,7 @@ __find_arguments(const char *fmt0, va_list ap, union arg **argtable, */ for (;;) { cp = fmt; - while ((n = mbrtowc(&wc, fmt, MB_CUR_MAX, &ps)) > 0) { + while ((n = ust_safe_mbrtowc(&wc, fmt, MB_CUR_MAX, &ps)) > 0) { fmt += n; if (wc == '%') { fmt--;