From 7796f674229e282f3a3b877e99bc687e0ab4e02e Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 1 Nov 2013 09:59:59 +0000 Subject: libcroco: Backport size checking fix (commit 209e5,aa60a) Fixed bugs: - https://launchpad.net/bugs/1246763 (bzr r12758) --- src/libcroco/cr-rgb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libcroco/cr-rgb.c b/src/libcroco/cr-rgb.c index e0c28701a..b9f78ddba 100644 --- a/src/libcroco/cr-rgb.c +++ b/src/libcroco/cr-rgb.c @@ -418,14 +418,14 @@ cr_rgb_set_from_name (CRRgb * a_this, const guchar * a_color_name) g_return_val_if_fail (a_this && a_color_name, CR_BAD_PARAM_ERROR); - for (i = 0; i < sizeof (gv_standard_colors); i++) { + for (i = 0; i < G_N_ELEMENTS (gv_standard_colors); i++) { if (!strcmp ((char *)a_color_name, gv_standard_colors[i].name)) { cr_rgb_set_from_rgb (a_this, &gv_standard_colors[i]); break; } } - if (i < sizeof (gv_standard_colors)) + if (i < G_N_ELEMENTS (gv_standard_colors)) status = CR_OK; else status = CR_UNKNOWN_TYPE_ERROR; -- cgit v1.2.3