[dev] [st] Two flaws with ISO 8613-6 colors, proper

From: Programmer <programmer_AT_verisimilitudes.net>
Date: Wed, 25 Jul 2018 15:10:28 -0400

Follows is the proper form of the st patch submitted earlier,
st-fix_8613_colors-0.8.1.diff:

diff -up st-0.8.1/st.c st-0.8.1-changed/st.c
--- st-0.8.1/st.c Tue Mar 20 15:29:59 2018
+++ st-0.8.1-changed/st.c Wed Jul 25 13:55:16 2018
_AT_@ -1157,7 +1157,7 @@ csiparse(void)
                         v = -1;
                 csiescseq.arg[csiescseq.narg++] = v;
                 p = np;
- if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ)
+ if (*p != ';' || *p != ':' || csiescseq.narg == ESC_ARG_SIZ)
                         break;
                 p++;
         }
_AT_@ -1311,16 +1311,16 @@ tdefcolor(int *attr, int *npar, int l)

         switch (attr[*npar + 1]) {
         case 2: /* direct color in RGB space */
- if (*npar + 4 >= l) {
+ if (*npar + 5 >= l) {
                         fprintf(stderr,
                                 "erresc(38): Incorrect number of parameters (%d)\n",
                                 *npar);
                         break;
                 }
- r = attr[*npar + 2];
- g = attr[*npar + 3];
- b = attr[*npar + 4];
- *npar += 4;
+ r = attr[*npar + 3];
+ g = attr[*npar + 4];
+ b = attr[*npar + 5];
+ *npar += 5;
                 if (!BETWEEN(r, 0, 255) || !BETWEEN(g, 0, 255) || !BETWEEN(b, 0, 255))
                         fprintf(stderr, "erresc: bad rgb color (%u,%u,%u)\n",
                                 r, g, b);
Received on Wed Jul 25 2018 - 21:10:28 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 25 2018 - 21:12:07 CEST