Fixed off-by-one bug in loop, illogical negation. - thanks for the bug report, Halenbane.

This commit is contained in:
Thomas Arp 2016-11-26 14:16:48 +01:00 committed by wyld-sw
parent ebfc7ce54b
commit bc786ae015

View file

@ -455,12 +455,12 @@ void script_syntax_highlighting(struct descriptor_data *d, char *string)
// Highlight lines
if (!comment) {
// Syntax replacement
for (i=0;i <= SYNTAX_TERMS;i++) {
for (i=0;i < SYNTAX_TERMS;i++) {
line = str_replace(line, syntax_color_replacement[i][0], syntax_color_replacement[i][1]);
}
// Commands replacement
for (i=0;i <= COMMAND_TERMS;i++) {
for (i=0;i < COMMAND_TERMS;i++) {
line = str_replace(line, command_color_replacement[i][0], command_color_replacement[i][1]);
}