shithub: mc

Download patch

ref: 02f19e5b2e6a94199d6eb9a97417e1feb3b2d0aa
parent: 1e4082af4e87a13f5babd52d0df55b7fdc8372c6
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]
+}