]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
strfmon: Fix formatting of a second fixed-width value
authorJose Luis Duran <jlduran@gmail.com>
Fri, 21 Oct 2022 19:34:09 +0000 (16:34 -0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 25 Oct 2022 21:40:17 +0000 (00:40 +0300)
commit34f88528edba44b2703ba8c772bef077eca33dab
tree4acdb68597430d5a5b938183b45f1276754a792a
parent750fe3e6a4619e040c7b0951775698b61290102e
strfmon: Fix formatting of a second fixed-width value

There is a bug when formatting two consecutive values using fixed-widths
and the values need padding.  This was because the value of pad_size
was zeroed only every other time.

Format           Before                         After
[%8n] [%8n]      [ $123.45] [       $123.45]    [ $123.45] [ $123.45]

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week
lib/libc/stdlib/strfmon.c
lib/libc/tests/stdlib/strfmon_test.c