fmt: fix formatter init

Width and precision may be abnormally large after format missing or wrong args.
This commit is contained in:
Jackz 2023-05-16 21:38:38 +08:00 committed by nkzxw
parent a440cc0d70
commit 83aa3b1378
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,8 @@ func (f *fmt) clearflags() {
func (f *fmt) init(buf *buffer) {
f.buf = buf
f.wid = 0
f.prec = 0
f.clearflags()
}