From 79de405977ac0d7820576b353dde07ce09cedba9 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Thu, 18 Mar 1999 03:40:20 -0500 Subject: snapshot of project "lynx", label v2-8-2dev_20 --- WWW/Library/Implementation/HTAnchor.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'WWW/Library/Implementation/HTAnchor.c') diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 9be41d00..9bfd8ccf 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -372,6 +372,8 @@ PUBLIC HTAnchor * HTAnchor_findAddress ARGS1( hash = HASH_FUNCTION(newdoc->address); if (!adult_table) { adult_table = (HTList **)calloc(HASH_SIZE, sizeof(HTList *)); + if (!adult_table) + outofmem(__FILE__, "HTAnchor_findAddress"); atexit(free_adult_table); } if (!adult_table[hash]) @@ -785,16 +787,6 @@ PUBLIC HyperDoc * HTAnchor_document ARGS1( } -/* We don't want code to change an address after anchor creation... yet ? -PUBLIC void HTAnchor_setAddress ARGS2( - HTAnchor *, me, - char *, addr) -{ - if (me) - StrAllocCopy (me->parent->address, addr); -} -*/ - PUBLIC char * HTAnchor_address ARGS1( HTAnchor *, me) { @@ -805,8 +797,13 @@ PUBLIC char * HTAnchor_address ARGS1( !((HTChildAnchor *)me)->tag) { /* it's an adult or no tag */ StrAllocCopy(addr, me->parent->address); } else { /* it's a named child */ - HTSprintf0(&addr, "%s#%s", - me->parent->address, ((HTChildAnchor *)me)->tag); + addr = malloc(2 + + strlen(me->parent->address) + + strlen(((HTChildAnchor *)me)->tag)); + if (addr == NULL) + outofmem(__FILE__, "HTAnchor_address"); + sprintf(addr, "%s#%s", + me->parent->address, ((HTChildAnchor *)me)->tag); } } return(addr); -- cgit 1.4.1-2-gfad0