[asterisk-commits] russell: branch russell/iax_refcount r79628 - /team/russell/iax_refcount/incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 15 17:15:33 CDT 2007


Author: russell
Date: Wed Aug 15 17:15:32 2007
New Revision: 79628

URL: http://svn.digium.com/view/asterisk?view=rev&rev=79628
Log:
ensure the return value of ast_str_hash is positive

Modified:
    team/russell/iax_refcount/include/asterisk/strings.h

Modified: team/russell/iax_refcount/include/asterisk/strings.h
URL: http://svn.digium.com/view/asterisk/team/russell/iax_refcount/include/asterisk/strings.h?view=diff&rev=79628&r1=79627&r2=79628
==============================================================================
--- team/russell/iax_refcount/include/asterisk/strings.h (original)
+++ team/russell/iax_refcount/include/asterisk/strings.h Wed Aug 15 17:15:32 2007
@@ -23,6 +23,7 @@
 #ifndef _ASTERISK_STRINGS_H
 #define _ASTERISK_STRINGS_H
 
+#include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
 
@@ -271,7 +272,7 @@
 	while (*str)
 		hash = hash * 33 ^ *str++;
 
-	return hash;
+	return abs(hash);
 }
 
 #endif /* _ASTERISK_STRINGS_H */




More information about the asterisk-commits mailing list