From 9deb4ebcea3ee0b217dee5d98e891cdec72ae943 Mon Sep 17 00:00:00 2001 From: reinelt Date: Tue, 27 Jan 2004 04:48:57 +0000 Subject: [lcd4linux @ 2004-01-27 04:48:57 by reinelt] bug with hash_age() fixed (thanks to Markus Keil for pointing this out) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@339 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- hash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 20e574d..83e42de 100644 --- a/hash.c +++ b/hash.c @@ -1,4 +1,4 @@ -/* $Id: hash.c,v 1.9 2004/01/22 07:57:45 reinelt Exp $ +/* $Id: hash.c,v 1.10 2004/01/27 04:48:57 reinelt Exp $ * * hashes (associative arrays) * @@ -23,6 +23,9 @@ * * * $Log: hash.c,v $ + * Revision 1.10 2004/01/27 04:48:57 reinelt + * bug with hash_age() fixed (thanks to Markus Keil for pointing this out) + * * Revision 1.9 2004/01/22 07:57:45 reinelt * several bugs fixed where segfaulting on layout>display * Crystalfontz driver optimized, 632 display already works @@ -155,8 +158,7 @@ static HASH_ITEM* hash_set_string (HASH *Hash, char *key, char *val) if (Item!=NULL) { if (Item->val) free (Item->val); Item->val = strdup(val); - gettimeofday(&(Item->time), NULL); - return Item; + goto hash_got_string; } // add entry @@ -170,6 +172,7 @@ static HASH_ITEM* hash_set_string (HASH *Hash, char *key, char *val) Item->val = strdup(val); Item->Slot = NULL; + hash_got_string: // set timestamps gettimeofday(&Hash->time, NULL); Item->time=Hash->time; -- cgit v1.2.3