Date: Sun, 6 Mar 2011 19:47:46 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219346 - head/lib/libc/stdio Message-ID: <201103061947.p26JlkDH007853@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Sun Mar 6 19:47:46 2011 New Revision: 219346 URL: http://svn.freebsd.org/changeset/base/219346 Log: Because we call __printf_out() with a on-stack buffer, also call __printf_flush() so we are sure it won't be referenced after we return. MFC after: 2 weeks Modified: head/lib/libc/stdio/xprintf_time.c Modified: head/lib/libc/stdio/xprintf_time.c ============================================================================== --- head/lib/libc/stdio/xprintf_time.c Sun Mar 6 18:43:59 2011 (r219345) +++ head/lib/libc/stdio/xprintf_time.c Sun Mar 6 19:47:46 2011 (r219346) @@ -62,7 +62,7 @@ __printf_render_time(struct __printf_io struct timespec *ts; time_t *tp; intmax_t t, tx; - int i, prec, nsec; + int i, prec, nsec, ret; if (pi->is_long) { tv = *((struct timeval **)arg[0]); @@ -116,5 +116,7 @@ __printf_render_time(struct __printf_io nsec /= 10; p += sprintf(p, ".%.*d", prec, nsec); } - return(__printf_out(io, pi, buf, p - buf)); + ret = __printf_out(io, pi, buf, p - buf); + __printf_flush(io); + return (ret); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103061947.p26JlkDH007853>