commit | 9b5000c920f2ba44dea1ef45f3a23191d46489b8 | [log] [tgz] |
---|---|---|
author | Rob Landley <rob@landley.net> | Mon Dec 22 17:04:47 2014 -0600 |
committer | Rob Landley <rob@landley.net> | Mon Dec 22 17:04:47 2014 -0600 |
tree | 15d489c64a098bcaf2a8dbe7e581781e8677338e | |
parent | ea8be3d41f1b818081012c79c0935f9c2173924d [diff] [blame] |
Allocate space for null terminator.
diff --git a/lib/lib.c b/lib/lib.c index 490235f..ade0786 100644 --- a/lib/lib.c +++ b/lib/lib.c
@@ -512,8 +512,7 @@ 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;