Loading...
libdarwin/string.c Libc-1353.11.2 Libc-1669.40.2
--- Libc/Libc-1353.11.2/libdarwin/string.c
+++ Libc/Libc-1669.40.2/libdarwin/string.c
@@ -71,6 +71,14 @@
 	}
 
 #pragma mark Top-Level Statics
+static const errno_desc_t _zero = {
+	.ed_error = 0,
+	.ed_sysexit = 0,
+	.ed_flags = 0,
+	.ed_sym = "0",
+	.ed_str = "successful termination",
+};
+
 static const errno_desc_t _negative_one = {
 	.ed_error = __ENEG_ONE,
 	.ed_sysexit = EXIT_FAILURE,
@@ -306,6 +314,10 @@
 static const errno_desc_t *
 _find_sysexit(int code)
 {
+	if (code == 0) {
+		return &_zero;
+	}
+
 	if (code == EX_BADRECEIPT_NP) {
 		return &_badreceipt;
 	}
@@ -353,9 +365,16 @@
 }
 
 const char *
+strexit_np(int code)
+{
+	const errno_desc_t *de = _find_sysexit(code);
+	return de->ed_str;
+}
+
+const char *
 symerror_np(int code)
 {
-	const errno_desc_t *de = _find_error(code);;
+	const errno_desc_t *de = _find_error(code);
 	return de->ed_sym;
 }