shithub: front

Download patch

ref: 698ecf25e5179a55847781fbe2b39de2e8d51810
parent: 394e9c223572b14d766c25fd864c621d7015d1a8
author: Jacob Moody <moody@posixcafe.org>
date: Fri Oct 4 20:36:48 EDT 2024

libc/runeistype: out of range is only > Runemax, Rune is a uint

--- a/sys/src/libc/port/runeistype.c
+++ b/sys/src/libc/port/runeistype.c
@@ -6,7 +6,7 @@
 int
 isspacerune(Rune c)
 {
-	if(c < 0 || c > Runemax)
+	if(c > Runemax)
 		return 0;
 	return (mergedlkup(c) & Lspace) == Lspace;
 }
@@ -14,7 +14,7 @@
 int
 isalpharune(Rune c)
 {
-	if(c < 0 || c > Runemax)
+	if(c > Runemax)
 		return 0;
 	return (mergedlkup(c) & Lalpha) == Lalpha;
 }
@@ -22,7 +22,7 @@
 int
 isdigitrune(Rune c)
 {
-	if(c < 0 || c > Runemax)
+	if(c > Runemax)
 		return 0;
 	return (mergedlkup(c) & Ldigit) == Ldigit;
 }
@@ -30,7 +30,7 @@
 int
 isupperrune(Rune c)
 {
-	if(c < 0 || c > Runemax)
+	if(c > Runemax)
 		return 0;
 	return (mergedlkup(c) & Lupper) == Lupper;
 }
@@ -38,7 +38,7 @@
 int
 islowerrune(Rune c)
 {
-	if(c < 0 || c > Runemax)
+	if(c > Runemax)
 		return 0;
 	return (mergedlkup(c) & Llower) == Llower;
 }
@@ -46,7 +46,7 @@
 int
 istitlerune(Rune c)
 {
-	if(c < 0 || c > Runemax)
+	if(c > Runemax)
 		return 0;
 	return (mergedlkup(c) & Ltitle) == Ltitle;
 }
--