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
commit748f4d3262d3e958f7f4096a99a8f8b357fd633a (patch)
treee8e00804b3cfca014ec4b7157042f7f33a18a07f
parent4e2c65d3920553c691560194e0df9f7efaa75c33 (diff)
eina: handle properly case where str != NULL and slen == 0eina-1.1
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 f7522dd..a9fa745 100644
--- a/src/lib/eina_stringshare.c
+++ b/src/lib/eina_stringshare.c
@@ -570,8 +570,10 @@ eina_stringshare_del(const char *str)
570EAPI const char * 570EAPI const char *
571eina_stringshare_add_length(const char *str, unsigned int slen) 571eina_stringshare_add_length(const char *str, unsigned int slen)
572{ 572{
573 if ((!str) || (slen <= 0)) 573 if (!str)
574 return NULL; 574 return NULL;
575 else if (slen == 0)
576 return "";
575 else if (slen == 1) 577 else if (slen == 1)
576 return (const char *)_eina_stringshare_single + ((*str) << 1); 578 return (const char *)_eina_stringshare_single + ((*str) << 1);
577 else if (slen < 4) 579 else if (slen < 4)