Kylie McClain pointed out that -z affects both input and output.

Can't say I'm happy with the API (-z and -Z to keep them independent would
be nice), but compatibility with what exists trumps having a good API...
diff --git a/toys/posix/sort.c b/toys/posix/sort.c
index b7e16c9..49e68c7 100644
--- a/toys/posix/sort.c
+++ b/toys/posix/sort.c
@@ -33,7 +33,7 @@
     -M	month sort (jan, feb, etc).
     -x	Hexadecimal numerical sort
     -s	skip fallback sort (only sort with keys)
-    -z	zero (null) terminated input
+    -z	zero (null) terminated lines
     -k	sort by "key" (see below)
     -t	use a key separator other than whitespace
     -o	output to FILE instead of stdout
@@ -384,9 +384,11 @@
   // Output result
   for (idx = 0; idx<TT.linecount; idx++) {
     char *s = TT.lines[idx];
-    xwrite(fd, s, strlen(s));
+    int i = strlen(s);
+
+    if (!(toys.optflags&FLAG_z)) s[i] = '\n';
+    xwrite(fd, s, i+1);
     if (CFG_TOYBOX_FREE) free(s);
-    xwrite(fd, "\n", 1);
   }
 
 exit_now: