summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/hash.c')
-rw-r--r--contrib/cvs/src/hash.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/cvs/src/hash.c b/contrib/cvs/src/hash.c
index 7e562b8..4a97784 100644
--- a/contrib/cvs/src/hash.c
+++ b/contrib/cvs/src/hash.c
@@ -195,7 +195,7 @@ freenode_mem (p)
free (p->key);
/* to be safe, re-initialize these */
- p->key = p->data = (char *) NULL;
+ p->key = p->data = NULL;
p->delproc = (void (*) ()) NULL;
}
@@ -402,6 +402,9 @@ sortlist (list, comp)
Node *head, *remain, *p, **array;
int i, n;
+ if (list == NULL)
+ return;
+
/* save the old first element of the list */
head = list->list;
remain = head->next;
@@ -488,8 +491,10 @@ printnode (node, closure)
return(0);
}
- (void) printf("Node at 0x%p: type = %s, key = 0x%p = \"%s\", data = 0x%p, next = 0x%p, prev = 0x%p\n",
- node, nodetypestring(node->type), node->key, node->key, node->data, node->next, node->prev);
+ (void) printf("Node at %p: type = %s, key = %p = \"%s\", data = %p, next = %p, prev = %p\n",
+ (void *)node, nodetypestring(node->type),
+ (void *)node->key, node->key, node->data,
+ (void *)node->next, (void *)node->prev);
return(0);
}
@@ -509,8 +514,8 @@ printlist (list)
return;
}
- (void) printf("List at 0x%p: list = 0x%p, HASHSIZE = %d, next = 0x%p\n",
- list, list->list, HASHSIZE, list->next);
+ (void) printf("List at %p: list = %p, HASHSIZE = %d, next = %p\n",
+ (void *)list, (void *)list->list, HASHSIZE, (void *)list->next);
(void) walklist(list, printnode, NULL);
OpenPOWER on IntegriCloud