]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
vt: Make a comparison <= for readability.
authorAdam Borowski <kilobyte@angband.pl>
Thu, 15 Sep 2016 14:47:10 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Sep 2016 09:41:54 +0000 (11:41 +0200)
All other uses of vc_npar are inclusive (save for < NPAR) which raises
eyebrows, so let's at least do so consistently.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c

index b51586fea4e84b11fea1f58b05ab1b2f3f67095a..52442ccf20c0a3514f8e060e00f05c759206261c 100644 (file)
@@ -1312,7 +1312,7 @@ static int vc_t416_color(struct vc_data *vc, int i,
        if (i > vc->vc_npar)
                return i;
 
-       if (vc->vc_par[i] == 5 && i < vc->vc_npar) {
+       if (vc->vc_par[i] == 5 && i + 1 <= vc->vc_npar) {
                /* 256 colours -- ubiquitous */
                i++;
                rgb_from_256(vc->vc_par[i], &c);