From 96704b2fc037f2b7906184d8580226a1e2611ae4 Mon Sep 17 00:00:00 2001 From: EvilPudding Date: Fri, 15 Apr 2016 13:24:03 +0000 Subject: [PATCH] Leaving the last byte in Colorpixel.hex NULL Added explicit assignment of last byte to the null character, for appearence's sake. --- libi3/get_colorpixel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libi3/get_colorpixel.c b/libi3/get_colorpixel.c index 218f82e6..dc6d7748 100644 --- a/libi3/get_colorpixel.c +++ b/libi3/get_colorpixel.c @@ -74,7 +74,10 @@ uint32_t get_colorpixel(const char *hex) { /* Store the result in the cache */ struct Colorpixel *cache_pixel = scalloc(1, sizeof(struct Colorpixel)); - strncpy(cache_pixel->hex, hex, 8); + + strncpy(cache_pixel->hex, hex, 7); + cache_pixel->hex[7] = '\0'; + cache_pixel->pixel = pixel; SLIST_INSERT_HEAD(&(colorpixels), cache_pixel, colorpixels); -- 2.39.5