shithub: mc

Download patch

ref: ba84514f495d26b22d4ac51a59444a8c4b17ed57
parent: 8642d21f5d716fb4e079aa6ef9df046ff493a39b
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Dec 25 19:26:41 EST 2014

Fix bug in exit.

    We would infinitely loop if we weren't exiting with n >= 100

--- a/libstd/syswrap+plan9-x64.myr
+++ b/libstd/syswrap+plan9-x64.myr
@@ -98,12 +98,11 @@
 		i = 100
 		n = 0
 		while i > 0
-			if i > status
-				continue
+			if i <= status
+				idx = (status/i)
+				idx %= 10
+				buf[n++] = digitchars[idx]
 			;;
-			idx = (status/i)
-			idx %= 10
-			buf[n++] = digitchars[idx];
 			i /= 10
 		;;
 		sys.exits(buf[:n])