eina: honor string length in eina_tmpstr_add_length.

This commit is contained in:
Cedric Bail 2013-10-16 18:14:15 +09:00
parent d33b0e03b7
commit 91e76f791d
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,8 @@ eina_tmpstr_add_length(const char *str, size_t length)
if (!s) return NULL;
s->length = length;
s->str = ((char *)s) + sizeof(Str);
strcpy(s->str, str);
strncpy(s->str, str, length);
s->str[length] = '\0';
eina_lock_take(&_mutex);
s->next = strs;
strs = s;