aboutsummaryrefslogtreecommitdiff
path: root/std/std.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/std.zig')
-rw-r--r--std/std.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/std/std.zig b/std/std.zig
index d42074a340..e1b66d9cb1 100644
--- a/std/std.zig
+++ b/std/std.zig
@@ -24,8 +24,7 @@ pub fn fprint_str(fd: isize, str: []const u8) -> isize {
// TODO handle buffering and flushing (mutex protected)
// TODO error handling
pub fn print_u64(x: u64) -> isize {
- // TODO use max_u64_base10_digits instead of hardcoding 20
- var buf: [20]u8;
+ var buf: [max_u64_base10_digits]u8;
const len = buf_print_u64(buf, x);
return write(stdout_fileno, buf.ptr, len);
}
@@ -33,8 +32,7 @@ pub fn print_u64(x: u64) -> isize {
// TODO handle buffering and flushing (mutex protected)
// TODO error handling
pub fn print_i64(x: i64) -> isize {
- // TODO use max_u64_base10_digits instead of hardcoding 20
- var buf: [20]u8;
+ var buf: [max_u64_base10_digits]u8;
const len = buf_print_i64(buf, x);
return write(stdout_fileno, buf.ptr, len);
}