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);
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to