From 1629622bffbdae30674bdd37ad264f7190f2b827 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Fri, 14 Jan 2022 10:56:04 +0100 Subject: [PATCH] Fixed range check for grayscale output --- src/iomanip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iomanip.cpp b/src/iomanip.cpp index 5198d01..b29e367 100644 --- a/src/iomanip.cpp +++ b/src/iomanip.cpp @@ -1,7 +1,7 @@ #include "iomanip.hpp" static std::ostream& gray(std::ostream& out, int val, int code) { - if (val < 0 || val > 24) { + if (val < 0 || val > 23) { throw std::invalid_argument("gray value out of range"); } out << "\x1b[" << code << ";5;" << 232 + val << "m";