Mercurial > hg > th-libs
changeset 665:4932188c9101
Oops, missed one case of * sizeof(th_char_t).
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 Jan 2020 07:51:07 +0200 |
parents | c5aa9ada1051 |
children | e1d27caf0dbd |
files | th_string.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/th_string.c Mon Jan 27 07:48:27 2020 +0200 +++ b/th_string.c Mon Jan 27 07:51:07 2020 +0200 @@ -26,10 +26,10 @@ return NULL; len = strlen(src); - if ((res = th_malloc(len + 1)) == NULL) + if ((res = th_malloc((len + 1) * sizeof(th_char_t))) == NULL) return NULL; - memcpy(res, src, len + 1); + memcpy(res, src, (len + 1) * sizeof(th_char_t)); return res; }