Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
borders.c lang.c tclass.c text.c
Log Message:
Additional NULL pointer checks (fixes some segv's).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -3 -r1.181 -r1.182
--- borders.c 23 May 2004 16:11:36 -0000 1.181
+++ borders.c 24 May 2004 17:39:51 -0000 1.182
@@ -735,16 +735,21 @@
static void
EwinWinpartITclassApply(EWin * ewin, int i)
{
+ const char *title;
+
IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active,
ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose);
if (ewin->border->part[i].flags == FLAG_TITLE)
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose,
- ewin->border->part[i].tclass, EwinGetTitle(ewin));
-
+ {
+ title = EwinGetTitle(ewin);
+ if (title)
+ TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
+ ewin->bits[i].w, ewin->bits[i].h, ewin->active,
+ ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose,
+ ewin->border->part[i].tclass, title);
+ }
}
static int
@@ -823,16 +828,19 @@
ChangeEwinWinpartContents(EWin * ewin, int i)
{
int state = 0, ret = 0;
+ const char *title;
EDBUG(3, "ChangeEwinWinpartContents");
ret = 1;
switch (ewin->border->part[i].flags)
{
case FLAG_TITLE:
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose,
- ewin->border->part[i].tclass, EwinGetTitle(ewin));
+ title = EwinGetTitle(ewin);
+ if (title)
+ TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
+ ewin->bits[i].w, ewin->bits[i].h, ewin->active,
+ ewin->sticky, state, ewin->bits[i].expose,
+ ewin->border->part[i].tclass, title);
break;
case FLAG_MINIICON:
break;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/lang.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- lang.c 23 May 2004 16:11:36 -0000 1.3
+++ lang.c 24 May 2004 17:39:51 -0000 1.4
@@ -97,6 +97,9 @@
if (Mode.text.utf8_int == want_utf8)
return (char *)str;
+ if (str == NULL)
+ return NULL;
+
if (want_utf8)
return Eiconv(iconv_cd_int2utf8, str, strlen(str));
@@ -114,7 +117,8 @@
if (Mode.text.utf8_int == want_utf8)
return;
- Efree((char *)str);
+ if (str)
+ Efree((char *)str);
#endif
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/tclass.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- tclass.c 23 May 2004 16:11:36 -0000 1.23
+++ tclass.c 24 May 2004 17:39:51 -0000 1.24
@@ -189,7 +189,7 @@
EDBUG(4, "TclassApply");
- if ((!iclass) || (!tclass) || (!win) || (w < 1) || (h < 1))
+ if ((!iclass) || (!tclass) || (!text) || (!win) || (w < 1) || (h < 1))
EDBUG_RETURN_;
if (Mode.queue_up)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/text.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- text.c 23 May 2004 16:11:36 -0000 1.39
+++ text.c 24 May 2004 17:39:51 -0000 1.40
@@ -245,6 +245,9 @@
*width = 0;
*height = 0;
+ if (!text)
+ EDBUG_RETURN_;
+
ts = TextGetState(tclass, active, sticky, state);
if (!ts)
EDBUG_RETURN_;
@@ -350,6 +353,9 @@
EDBUG(4, "TextDraw");
+ if (!text)
+ EDBUG_RETURN_;
+
ts = TextGetState(tclass, active, sticky, state);
if (!ts)
EDBUG_RETURN_;
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs