memcpy had of-by-one error.
Also, remove unneeded defines.

Signed-off-by: Justin Cinkelj <justin.cink...@xlab.si>
---
 libc/string/stresep.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/libc/string/stresep.c b/libc/string/stresep.c
index 4d72391..5ac4b85 100644
--- a/libc/string/stresep.c
+++ b/libc/string/stresep.c
@@ -30,22 +30,10 @@
  */
 
 #include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)strsep.c   8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: stresep.c,v 1.3 2017/02/12 17:19:00 maya Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
 
 #include <assert.h>
 #include <string.h>
-
-#ifdef __weak_alias
-__weak_alias(stresep,_stresep)
-#endif
+#define _DIAGASSERT assert
 
 /*
  * Get next token from string *stringp, where tokens are possibly-empty
@@ -76,7 +64,7 @@ stresep(char **stringp, const char *delim, int esc)
        for (tok = s;;) {
                c = *s++;
                while (esc != '\0' && c == esc) {
-                       memmove(s - 1, s, strlen(s));
+                       memmove(s - 1, s, strlen(s) + 1);
                        c = *s++;
                }
                spanp = delim;
-- 
2.9.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to