diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-04-30 00:17:56 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-04-30 00:17:56 +0000 |
| commit | afc1e28e76dde04ec7a4e07ffedeb713c4ed1f01 (patch) | |
| tree | cb2f58ed0d8505840905118e6d773223a6706cd1 /lib/libforms | |
| parent | 3ea2f344e03be8a05bf0727985abfbff16e41b37 (diff) | |
Notes
Diffstat (limited to 'lib/libforms')
| -rw-r--r-- | lib/libforms/bindings.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libforms/bindings.c b/lib/libforms/bindings.c index 947b5ee47bdd..4ebdd8d99b73 100644 --- a/lib/libforms/bindings.c +++ b/lib/libforms/bindings.c @@ -45,6 +45,12 @@ bind_tuple(hash_table *htable, char *name, { struct Tuple *tuple; + /* First check to see if we've been bound in already */ + if (hash_search(htable, tuple->name, NULL, NULL)) { + warn("Duplicate tuple name, %s, skipping", name); + return (ST_ERROR); + } + tuple = malloc(sizeof (struct Tuple)); if (!tuple) { warn("Couldn't allocate memory for new tuple"); @@ -55,10 +61,8 @@ bind_tuple(hash_table *htable, char *name, tuple->type = type; tuple->addr = fn; - if (hash_search(htable, tuple->name, tuple, NULL)) { - warn("Duplicate tuple name, %s, skipping", name); - return (ST_ERROR); - } + /* Insert it */ + hash_search(htable, tuple->name, tuple, NULL); #ifdef DEBUG debug_dump_table(htable); |
