shithub: mc

Download patch

ref: 2989b27ec70e6b762a3766a723ebeeff3617ad8e
parent: 275c62e9be90ff03a115bce70a014b3975c637ce
author: Ori Bernstein <[email protected]>
date: Mon Dec 29 18:12:58 EST 2014

Add a C string conversion utility, and use it for sysinfo

--- /dev/null
+++ b/libstd/cstrconv.myr
@@ -1,0 +1,12 @@
+pkg std =
+	const cstrconv	: (buf : byte[:] -> byte[:])
+;;
+
+const cstrconv = {buf
+	for i = 0; i < buf.len; i++
+		if buf[i] == 0
+			break
+		;;
+	;;
+	-> buf[:i]
+}