shithub: scc

Download patch

ref: 7599d1a808bd0b604b7e5cde5a84342cf868509e
parent: f8e18c25020d34e589f51f0436a62f2284ca2ec3
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Mar 3 14:30:38 EST 2017

[libc] Fix touper() and tolower()

--- a/libc/src/tolower.c
+++ b/libc/src/tolower.c
@@ -6,5 +6,5 @@
 int
 tolower(int c)
 {
-	return (isupper(c)) ? c & ~0x20 : c;
+	return (isupper(c)) ? c | 0x20 : c;
 }
--- a/libc/src/toupper.c
+++ b/libc/src/toupper.c
@@ -7,5 +7,5 @@
 int
 toupper(int c)
 {
-	return (islower(c)) ? c | 0x20 : c;
+	return (islower(c)) ? c & ~0x20 : c;
 }