aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2013-02-28 07:49:16 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-02-28 07:49:16 +0900
commitfde00d91a879dd44e69e65e1c1238ed96daa63be (patch)
tree13f9105f84ba5bca6dd3f696f7365e0de69a856d
parent23cbcb5fa42f84b7ae55babbe7f7111c71f261f7 (diff)
downloadefl-fde00d91a879dd44e69e65e1c1238ed96daa63be.tar.gz
efl-fde00d91a879dd44e69e65e1c1238ed96daa63be.tar.xz
efl-fde00d91a879dd44e69e65e1c1238ed96daa63be.zip
eina: eina_strlcat now work with NULL src.
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--src/lib/eina/eina_str.c21
3 files changed, 18 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 69be09eb6..bd1ab8199 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-28 Cedric Bail
+
+ * eina_strlcat work with a NULL src.
+
+
2013-02-26 Carsten Haitzler (The Rasterman)
* Fix evas GL common engine to have a shader to do oversampling on
diff --git a/NEWS b/NEWS
index 2bfd3763a..71d46a4a8 100644
--- a/NEWS
+++ b/NEWS
@@ -114,6 +114,7 @@ Improvements:
* edje: reduce memory consumption of Edje program handler.
* eina, evas: improved support for 64bits system.
* Evas GL engine downscale quality in smooth mode much improved with multisampling up to effectively 16x16 via shaders.
+ * eina: eina_strlcat now work with a NULL source.
Fixes:
* Fix a memory leak in ecore_con_dns when using ecore_con_server_connect
diff --git a/src/lib/eina/eina_str.c b/src/lib/eina/eina_str.c
index 65389c7cd..0409859eb 100644
--- a/src/lib/eina/eina_str.c
+++ b/src/lib/eina/eina_str.c
@@ -347,16 +347,19 @@ eina_strlcat(char *dst, const char *src, size_t siz)
n = siz - dlen;
if (n == 0)
- return(dlen + strlen(s));
+ return(dlen + (s ? strlen(s) : 0));
- while (*s != '\0') {
- if (n != 1)
- {
- *d++ = *s;
- n--;
- }
-
- s++;
+ if (s != NULL)
+ {
+ while (*s != '\0') {
+ if (n != 1)
+ {
+ *d++ = *s;
+ n--;
+ }
+
+ s++;
+ }
}
*d = '\0';