aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/sed.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/posix/sed.c b/toys/posix/sed.c
index a57891e5..30d8a154 100644
--- a/toys/posix/sed.c
+++ b/toys/posix/sed.c
@@ -827,8 +827,7 @@ static void jewel_of_judgement(char **pline, long len)
if (strchr("aiqr=", c) && i>1) break;
// Add step to pattern
- corwin = xmalloc(reg-toybuf);
- memcpy(corwin, toybuf, reg-toybuf);
+ corwin = xmemdup(toybuf, reg-toybuf);
reg = (reg-toybuf) + (char *)corwin;
// Parse arguments by command type