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
commit7b1abad3ea3571fba4e952448be3a2214af216f7 (patch)
treeba60237b1eb2a9a65a2f9b3e5d9115a29c728017
parent279937a6b9d9838e98260f1946485d4acd78acc1 (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 6d236c5..42fc536 100644
--- a/src/lib/eina_stringshare.c
+++ b/src/lib/eina_stringshare.c
@@ -611,8 +611,10 @@ eina_stringshare_del(Eina_Stringshare *str)
611EAPI Eina_Stringshare * 611EAPI Eina_Stringshare *
612eina_stringshare_add_length(const char *str, unsigned int slen) 612eina_stringshare_add_length(const char *str, unsigned int slen)
613{ 613{
614 if ((!str) || (slen <= 0)) 614 if (!str)
615 return NULL; 615 return NULL;
616 else if (slen == 0))
617 return "";
616 else if (slen == 1) 618 else if (slen == 1)
617 return (Eina_Stringshare *) _eina_stringshare_single + ((*str) << 1); 619 return (Eina_Stringshare *) _eina_stringshare_single + ((*str) << 1);
618 else if (slen < 4) 620 else if (slen < 4)