Fix two off-by-one errors
This commit is contained in:
parent
829463f8ee
commit
4793e93d69
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue