diff --git a/src/extern.h.in b/src/extern.h.in index f745407..a60be86 100644 --- a/src/extern.h.in +++ b/src/extern.h.in @@ -55,6 +55,9 @@ #define CYAN 36 #define WHITE 37 +/* html color code length (type of #FF0000, etc.) without the # */ +#define HTMLCOLORCODELENGTH 6 + struct conf { int chead; /* color used for the header */ int clow; /* color when usage low */ diff --git a/src/util.c b/src/util.c index f64e02d..1c8f09e 100644 --- a/src/util.c +++ b/src/util.c @@ -872,11 +872,11 @@ chk_html_colorcode(char *color) { int i; - if (strlen(color) != 6) + if (strlen(color) != HTMLCOLORCODELENGTH) return -1; /* NOTREACHED */ - for (i = 0; i < 6; i++) + for (i = 0; i < HTMLCOLORCODELENGTH; i++) if (isxdigit(color[i]) == 0) return -1; /* NOTREACHED */