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
commit4b14ea628c1e029e84a59188981b4c4ca1d7d29f (patch)
tree55d66b37f7a6b12fd30114f6096405ec28425485
parent7a132e9c086dc5c6b3aafe83d878e74aad041291 (diff)
eina: handle properly case where str != NULL and slen == 0
SVN revision: 78222
-rw-r--r--src/lib/eina/eina_stringshare.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/eina/eina_stringshare.c b/src/lib/eina/eina_stringshare.c
index 6d236c53c0..2a457f4736 100644
--- a/src/lib/eina/eina_stringshare.c
+++ b/src/lib/eina/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)