From 9e198a8dfb3e0074f3c7f46efd09f4ddac41aad8 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Fri, 14 Jan 2011 06:46:04 +0000 Subject: [PATCH] prevent macro null derefs git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56102 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index c79291b..00f4b48 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -208,7 +208,7 @@ typedef struct _Evas_Object_Textblock_Format Evas_Object_Textblock_Format; * the current char pointed to and decrements ind but ensures it stays in * the text range. */ -#define GET_PREV(text, ind) (((ind) > 0) ? (text[(ind)--]) : (text[ind])) +#define GET_PREV(text, ind) (text ? (((ind) > 0) ? (text[(ind)--]) : (text[ind])) : 0) /** * @internal * @def GET_NEXT(text, ind) @@ -216,7 +216,7 @@ typedef struct _Evas_Object_Textblock_Format Evas_Object_Textblock_Format; * the current char pointed to and increments indd but ensures it stays in * the text range. */ -#define GET_NEXT(text, ind) ((text[ind]) ? (text[(ind)++]) : (text[ind])) +#define GET_NEXT(text, ind) (text ? ((text[ind]) ? (text[(ind)++]) : (text[ind])) : 0) /*FIXME: document the structs and struct items. */ struct _Evas_Object_Style_Tag -- 2.7.4