Actually, use xstrdup where we can not use strcpy - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
Log
Files
Refs
Tags
README
LICENSE
---
commit 9525546dc2dc01b8d555990827959208282f66f8
parent 0b862a1985fd1623141a6b9463d0cc50e4fab158
Author: Quentin Rameau 
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(-)
---
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;
 }