Actually, use xstrdup where we can not use strcpy - geomyidae - A small C-based gopherd.
(HTM) git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 9525546dc2dc01b8d555990827959208282f66f8
(DIR) parent 0b862a1985fd1623141a6b9463d0cc50e4fab158
(HTM) Author: Quentin Rameau <quinq@fifth.space>
Date: Thu, 30 Aug 2018 22:07:15 +0200
Actually, use xstrdup where we can not use strcpy
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
M ind.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
---
(DIR) diff --git a/ind.c b/ind.c
@@ -290,14 +290,9 @@ freeindex(Indexs *i)
void
addelem(Elems *e, char *s)
{
- int slen;
-
- slen = strlen(s) + 1;
-
e->num++;
e->e = xrealloc(e->e, sizeof(char *) * e->num);
- e->e[e->num - 1] = xmalloc(slen);
- strcpy(e->e[e->num - 1], s);
+ e->e[e->num - 1] = xstrdup(s);
return;
}