From 93ca0c4a5e040baacfdda495439c4a21467e0e51 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Sun, 14 Aug 2022 21:05:37 +0200 Subject: [PATCH] fix: off-by-one in `isCntrl` 0x1F (`control_code.us`) itself is also a control code. --- lib/std/ascii.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/ascii.zig b/lib/std/ascii.zig index 4a4564d3d7..663f7df94f 100644 --- a/lib/std/ascii.zig +++ b/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 {