From f7c3c4ca429260c4d056b1e032e05162e25554ca Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Thu, 4 Mar 1999 10:56:18 -0500 Subject: snapshot of project "lynx", label v2-8-2dev_18 --- WWW/Library/Implementation/HTAnchor.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'WWW/Library/Implementation/HTAnchor.c') diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 9e3933ad..9be41d00 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -901,11 +901,21 @@ PUBLIC void HTAnchor_setTitle ARGS2( int i; if (me) { - StrAllocCopy(me->title, title); - for (i = 0; me->title[i]; i++) { - if ((unsigned char)me->title[i] == 1 || - (unsigned char)me->title[i] == 2) { - me->title[i] = ' '; + if (title) { + StrAllocCopy(me->title, title); + for (i = 0; me->title[i]; i++) { + if ((unsigned char)me->title[i] == 1 || + (unsigned char)me->title[i] == 2) { + me->title[i] = ' '; + } + } + } else { + CTRACE(tfp,"HTAnchor_setTitle: New title is NULL! "); + if (me->title) { + CTRACE(tfp,"Old title was \"%s\".\n", me->title); + FREE(me->title); + } else { + CTRACE(tfp,"Old title was NULL.\n"); } } } -- cgit 1.4.1-2-gfad0