summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-10-16 18:14:15 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-10-16 18:56:32 +0900
commit91e76f791d0e0ed2bf227a030b351ea2dd5a9fac (patch)
treee8b02b3edeea237c1c0016c1adf6af904e096e3a /src/lib/eina
parentd33b0e03b73efb2febe14b25a25464e41d9b1225 (diff)
eina: honor string length in eina_tmpstr_add_length.
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_tmpstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/eina/eina_tmpstr.c b/src/lib/eina/eina_tmpstr.c
index bc31a58040..711a1757f3 100644
--- a/src/lib/eina/eina_tmpstr.c
+++ b/src/lib/eina/eina_tmpstr.c
@@ -76,7 +76,8 @@ eina_tmpstr_add_length(const char *str, size_t length)
76 if (!s) return NULL; 76 if (!s) return NULL;
77 s->length = length; 77 s->length = length;
78 s->str = ((char *)s) + sizeof(Str); 78 s->str = ((char *)s) + sizeof(Str);
79 strcpy(s->str, str); 79 strncpy(s->str, str, length);
80 s->str[length] = '\0';
80 eina_lock_take(&_mutex); 81 eina_lock_take(&_mutex);
81 s->next = strs; 82 s->next = strs;
82 strs = s; 83 strs = s;