mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix Formatter.print returning incorrect size (#2306)
* Fix `Formatter.print` returning incorrect size
This commit is contained in:
committed by
GitHub
parent
adb3df05c6
commit
cf913b41c6
@@ -69,7 +69,6 @@ struct Formatter
|
||||
PrintFlags flags;
|
||||
uint width;
|
||||
uint prec;
|
||||
usz idx;
|
||||
fault first_fault;
|
||||
}
|
||||
}
|
||||
@@ -571,5 +570,5 @@ fn usz? Formatter.print(&self, String str)
|
||||
self.out_fn = &out_null_fn;
|
||||
}
|
||||
foreach (c : str) self.out(c)!;
|
||||
return self.idx;
|
||||
return str.len;
|
||||
}
|
||||
|
||||
@@ -660,7 +660,6 @@ fn usz? Formatter.out_char(&self, any arg) @private
|
||||
fn usz? Formatter.out_reverse(&self, char[] buf) @private
|
||||
{
|
||||
usz n;
|
||||
usz buffer_start_idx = self.idx;
|
||||
usz len = buf.len;
|
||||
// pad spaces up to given width
|
||||
if (!self.flags.zeropad && !self.flags.left)
|
||||
|
||||
Reference in New Issue
Block a user