From 107740ca5e89b43171f37cb4d75c8b1dc2d53fc7 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Tue, 6 Jun 2017 10:02:53 +0100 Subject: [PATCH] Fix issue #69 for fmt.printf padding --- core/fmt.odin | 34 ++++++++++++++++++++++++++-------- core/strconv.odin | 12 ++++++------ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/core/fmt.odin b/core/fmt.odin index 3053b6af1..780183546 100644 --- a/core/fmt.odin +++ b/core/fmt.odin @@ -500,14 +500,14 @@ fmt_write_padding :: proc(fi: ^FmtInfo, width: int) { if width <= 0 { return; } - pad_byte: byte = ' '; - if fi.zero { - pad_byte = '0'; + pad_byte: byte = '0'; + if fi.space { + pad_byte = ' '; } data := string_buffer_data(fi.buf^); count := min(width, cap(data)-len(data)); - for _ in 0..count { + for _ in 0..