summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-10-19 04:38:08 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-10-19 04:38:08 +0000
commitf84f45923f9869625c29a55a9072e4202e00d58c (patch)
tree4ebbf3f4820dfd93681cdd5230670c8f938a40ce
parentf345c066874699ab043edf9fa0fb75e37dd66603 (diff)
eina: handle properly case where str != NULL and slen == 0
SVN revision: 78222
-rw-r--r--src/lib/eina_stringshare.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/eina_stringshare.c b/src/lib/eina_stringshare.c
index 5c4b6f8..49a24f4 100644
--- a/src/lib/eina_stringshare.c
+++ b/src/lib/eina_stringshare.c
@@ -657,7 +657,9 @@ eina_stringshare_add_length(const char *str, unsigned int slen)
657{ 657{
658 DBG("str=%p (%.*s), slen=%u", str, slen, str ? str : "", slen); 658 DBG("str=%p (%.*s), slen=%u", str, slen, str ? str : "", slen);
659 659
660 if ((!str) || (slen <= 0)) 660 if (!str)
661 return NULL;
662 else if (slen == 0))
661 return NULL; 663 return NULL;
662 else if (slen == 1) 664 else if (slen == 1)
663 return (const char *)_eina_stringshare_single + ((*str) << 1); 665 return (const char *)_eina_stringshare_single + ((*str) << 1);