Commit 93ca0c4a5e

r00ster91 <r00ster91@proton.me>
2022-08-14 21:05:37
fix: off-by-one in `isCntrl`
0x1F (`control_code.us`) itself is also a control code.
1 parent aa0b93e
Changed files (1)
lib
lib/std/ascii.zig
@@ -232,7 +232,7 @@ pub fn isAlpha(c: u8) bool {
 }
 
 pub fn isCntrl(c: u8) bool {
-    return c < 0x20 or c == 127; //DEL
+    return c <= control_code.us or c == control_code.del;
 }
 
 pub fn isDigit(c: u8) bool {