aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-03-19 16:59:11 +0000
committerGinger Bill <bill@gingerbill.org>2017-03-19 16:59:11 +0000
commit5562364a98f01a0c0221a70345656d45de0d2009 (patch)
tree3ea4409ec3fcd1b7469c96d0e6ff03b437f8f823 /core
parent32150e401e39bd68f9882c3983829e744603dac1 (diff)
Add branch labels for loops; using list
Diffstat (limited to 'core')
-rw-r--r--core/fmt.odin6
-rw-r--r--core/strconv.odin4
2 files changed, 4 insertions, 6 deletions
diff --git a/core/fmt.odin b/core/fmt.odin
index 56fde40dc..ceae65e82 100644
--- a/core/fmt.odin
+++ b/core/fmt.odin
@@ -295,15 +295,15 @@ bprintln :: proc(buf: ^[]byte, args: ..any) -> int {
sprint :: proc(buf: []byte, args: ..any) -> string {
count := bprint(^buf, ..args);
- return cast(string)buf;
+ return cast(string)buf[..count];
}
sprintln :: proc(buf: []byte, args: ..any) -> string {
count := bprintln(^buf, ..args);
- return cast(string)buf;
+ return cast(string)buf[..count];
}
sprintf :: proc(buf: []byte, fmt: string, args: ..any) -> string {
count := bprintf(^buf, fmt, ..args);
- return cast(string)buf;
+ return cast(string)buf[..count];
}
diff --git a/core/strconv.odin b/core/strconv.odin
index e21104819..5710e76de 100644
--- a/core/strconv.odin
+++ b/core/strconv.odin
@@ -30,9 +30,7 @@ append_uint :: proc(buf: []byte, u: u64, base: int) -> string {
append_int :: proc(buf: []byte, i: i64, base: int) -> string {
return append_bits(buf, cast(u64)i, base, true, 8*size_of(int), digits, 0);
}
-itoa :: proc(buf: []byte, i: int) -> string {
- return append_int(buf, cast(i64)i, 10);
-}
+itoa :: proc(buf: []byte, i: int) -> string { return append_int(buf, cast(i64)i, 10); }
append_float :: proc(buf: []byte, f: f64, fmt: byte, prec, bit_size: int) -> string {
return cast(string)generic_ftoa(buf, f, fmt, prec, bit_size);