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
This commit is contained in:
parent
8bca3d08d5
commit
afeb46924f
@ -62,7 +62,7 @@ __printf_render_time(struct __printf_io *io, const struct printf_info *pi, const
|
||||
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 *io, const struct printf_info *pi, const
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user