projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea8be3d
)
Allocate space for null terminator.
author
Rob Landley
<rob@landley.net>
Mon, 22 Dec 2014 23:04:47 +0000
(17:04 -0600)
committer
Rob Landley
<rob@landley.net>
Mon, 22 Dec 2014 23:04:47 +0000
(17:04 -0600)
lib/lib.c
patch
|
blob
|
history
diff --git
a/lib/lib.c
b/lib/lib.c
index
490235f
..
ade0786
100644
(file)
--- a/
lib/lib.c
+++ b/
lib/lib.c
@@
-512,8
+512,7
@@
int copy_tempfile(int fdin, char *name, char **tempname)
struct stat statbuf;
int fd;
- *tempname = xstrndup(name, strlen(name)+6);
- strcat(*tempname,"XXXXXX");
+ *tempname = xmprintf("%s%s", name, "XXXXXX");
if(-1 == (fd = mkstemp(*tempname))) error_exit("no temp file");
if (!tempfile2zap) sigatexit(tempfile_handler);
tempfile2zap = *tempname;