probably long overdue - if stringshare add/del get a null string - safely

return null or just return


SVN revision: 33576
This commit is contained in:
Carsten Haitzler 2008-01-24 00:57:20 +00:00
parent 7bc642aff1
commit 40843fe689
2 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,7 @@ evas_stringshare_add(const char *str)
char *el_str;
Evas_Stringshare_El *el, *pel = NULL;
if (!str) return NULL;
hash_num = _evas_stringshare_hash_gen(str, &slen);
for (el = share.buckets[hash_num]; el; pel = el, el = el->next)
{
@ -91,6 +92,7 @@ evas_stringshare_del(const char *str)
char *el_str;
Evas_Stringshare_El *el, *pel = NULL;
if (!str) return;
hash_num = _evas_stringshare_hash_gen(str, &slen);
for (el = share.buckets[hash_num]; el; pel = el, el = el->next)
{

View File

@ -53,6 +53,7 @@
#include <sys/stat.h>
#include <time.h>
#include <ctype.h>
#include <stdint.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>