diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-02-14 08:50:27 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-02-14 08:51:11 +0100 |
commit | 4793e93d6954f1de2473d216a5c40c78f5f67022 (patch) | |
tree | 6c1e8f595714f0336e52add75308edd9738b3ef1 | |
parent | 829463f8ee1a696cbbfd49eb08e7d78881335213 (diff) | |
download | neetdraw-4793e93d6954f1de2473d216a5c40c78f5f67022.tar.gz neetdraw-4793e93d6954f1de2473d216a5c40c78f5f67022.tar.xz neetdraw-4793e93d6954f1de2473d216a5c40c78f5f67022.zip |
Fix two off-by-one errors
-rw-r--r-- | autistdraw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/autistdraw.c b/autistdraw.c index 72484f7..2899251 100644 --- a/autistdraw.c +++ b/autistdraw.c @@ -663,7 +663,7 @@ color_to_ansi (uint8_t color) "\033[0;1;7;37m", }; - if (color > sizeof table / sizeof table[0]) + if (color >= sizeof table / sizeof table[0]) return NULL; return table[color]; } @@ -742,7 +742,7 @@ color_to_mirc (uint8_t color) MIRC_L_BLUE, MIRC_L_PURPLE, MIRC_L_CYAN, MIRC_WHITE }; - if (color > sizeof table / sizeof table[0]) + if (color >= sizeof table / sizeof table[0]) return MIRC_NONE; return table[color]; } |