aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/sed.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-01-28 13:36:12 -0600
committerRob Landley <rob@landley.net>2016-01-28 13:36:12 -0600
commit8f7137e4e4850e17eea8c045865885bb1bc2f3bc (patch)
treebea4c382b22f63358f0eaa04d2c944234f04aa19 /toys/posix/sed.c
parent33f50f5ff5930815e0a6a6e4af55905df2ec6bdf (diff)
downloadtoybox-8f7137e4e4850e17eea8c045865885bb1bc2f3bc.tar.gz
Bugfix I forgot to checkin, plus a wrapper function.
Diffstat (limited to 'toys/posix/sed.c')
-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