summaryrefslogtreecommitdiffstats
path: root/lib/fileutils.c
diff options
context:
space:
mode:
authorSami Kerola2012-02-29 15:54:24 +0100
committerSami Kerola2012-03-18 14:28:05 +0100
commit6f312c89578be7b8d0a47c75a4de4cc8c190e40e (patch)
treecde8876c4831c709bc210455bccd0b70aa2e1b52 /lib/fileutils.c
parentinclude: add asprintf wrapper (diff)
downloadkernel-qcow2-util-linux-6f312c89578be7b8d0a47c75a4de4cc8c190e40e.tar.gz
kernel-qcow2-util-linux-6f312c89578be7b8d0a47c75a4de4cc8c190e40e.tar.xz
kernel-qcow2-util-linux-6f312c89578be7b8d0a47c75a4de4cc8c190e40e.zip
xalloc: use xasprintf in all files
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'lib/fileutils.c')
-rw-r--r--lib/fileutils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/fileutils.c b/lib/fileutils.c
index ed97967a3..819298935 100644
--- a/lib/fileutils.c
+++ b/lib/fileutils.c
@@ -9,6 +9,7 @@
#include "c.h"
#include "pathnames.h"
+#include "xalloc.h"
/* Create open temporary file in safe way. Please notice that the
* file permissions are -rw------- by default. */
@@ -22,10 +23,10 @@ FILE *xmkstemp(char **tmpname)
tmpenv = getenv("TMPDIR");
if (tmpenv)
- asprintf(&localtmp, "%s/%s.XXXXXX", tmpenv,
+ xasprintf(&localtmp, "%s/%s.XXXXXX", tmpenv,
program_invocation_short_name);
else
- asprintf(&localtmp, "%s/%s.XXXXXX", _PATH_TMP,
+ xasprintf(&localtmp, "%s/%s.XXXXXX", _PATH_TMP,
program_invocation_short_name);
old_mode = umask(077);
fd = mkstemp(localtmp);