From b2e46be1572da6cb2a79889547c5cf3a120afaeb Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 14 Jan 2011 06:46:04 +0000 Subject: [PATCH] prevent macro null derefs SVN revision: 56102 --- legacy/evas/src/lib/canvas/evas_object_textblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index c79291b296..00f4b48cfe 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/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