about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTAnchor.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-03-18 03:40:20 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1999-03-18 03:40:20 -0500
commit79de405977ac0d7820576b353dde07ce09cedba9 (patch)
treed9c4fe55a871bb65fc0e1448764604b47083100e /WWW/Library/Implementation/HTAnchor.c
parent2d9e91f9543486865c65bf1b2837b2a7a1e3d1b9 (diff)
downloadlynx-snapshots-79de405977ac0d7820576b353dde07ce09cedba9.tar.gz
snapshot of project "lynx", label v2-8-2dev_20
Diffstat (limited to 'WWW/Library/Implementation/HTAnchor.c')
-rw-r--r--WWW/Library/Implementation/HTAnchor.c21
1 files changed, 9 insertions, 12 deletions
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);