diff options
Diffstat (limited to 'src/Color.c')
-rw-r--r-- | src/Color.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Color.c b/src/Color.c index 23ef800..9139068 100644 --- a/src/Color.c +++ b/src/Color.c @@ -34,18 +34,19 @@ XRenderParseColor(Display *dpy, char *spec, XRenderColor *def) { unsigned short elements[4]; unsigned short *pShort; - int i, n; - char c; spec += 5; /* * Attempt to parse the value portion. */ pShort = elements; - for (i = 0; i < 4; i++, pShort++, spec++) { - n = 0; + for (int i = 0; i < 4; i++, pShort++, spec++) { + int n = 0; + *pShort = 0; while (*spec != '/' && *spec != '\0') { + char c; + if (++n > 4) { return 0; } |