1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

strconv: fix v_sprintf with '%%' (#17708)

This commit is contained in:
yuyi
2023-03-19 15:52:45 +08:00
committed by GitHub
parent 3793bf1c99
commit 9275161d0f
2 changed files with 12 additions and 0 deletions

View File

@ -75,6 +75,12 @@ pub fn v_sprintf(str string, pt ...voidptr) string {
i++
continue
}
if ch == `%` && status == .field_char {
status = .norm_char
res.write_u8(ch)
i++
continue
}
if ch == `%` && status == .norm_char {
status = .field_char
i++