summaryrefslogtreecommitdiff
path: root/lib/std/cstrconv.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/cstrconv.myr')
-rw-r--r--lib/std/cstrconv.myr12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/std/cstrconv.myr b/lib/std/cstrconv.myr
index fa9e0bf..a517e19 100644
--- a/lib/std/cstrconv.myr
+++ b/lib/std/cstrconv.myr
@@ -7,9 +7,7 @@ pkg std =
;;
const cstrconv = {buf
- var i
-
- for i = 0; i < buf.len; i++
+ for var i = 0; i < buf.len; i++
if buf[i] == 0
-> buf[:i]
;;
@@ -29,12 +27,10 @@ const cstrconvp = {p
}
const cstrlen = {buf
- var i
-
- for i = 0; i < buf.len; i++
+ for var i = 0; i < buf.len; i++
if buf[i] == 0
- break
+ -> i
;;
;;
- -> i
+ -> 0
}