From 6029ff9f0a02bc42dcc270be864a3ff9a541b0e5 Mon Sep 17 00:00:00 2001
From: Marcus Comstedt <marcus@mc.pp.se>
Date: Tue, 23 Feb 1999 12:18:36 +0100
Subject: [PATCH] Now the value of hash("") is deterministic...

Rev: src/pike_memory.c:1.30
---
 src/pike_memory.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/pike_memory.c b/src/pike_memory.c
index ef8332ea99..87bea63820 100644
--- a/src/pike_memory.c
+++ b/src/pike_memory.c
@@ -9,7 +9,7 @@
 #include "pike_macros.h"
 #include "gc.h"
 
-RCSID("$Id: pike_memory.c,v 1.29 1999/01/31 09:01:58 hubbe Exp $");
+RCSID("$Id: pike_memory.c,v 1.30 1999/02/23 11:18:36 marcus Exp $");
 
 /* strdup() is used by several modules, so let's provide it */
 #ifndef HAVE_STRDUP
@@ -222,7 +222,8 @@ unsigned INT32 hashstr(const unsigned char *str,INT32 maxn)
 {
   unsigned INT32 ret,c;
   
-  ret=str++[0];
+  if(!(ret=str++[0]))
+    return ret;
   for(; maxn>=0; maxn--)
   {
     c=str++[0];
-- 
GitLab