From 025b4507c9e692561831ee9c2ddbc18b661e15c9 Mon Sep 17 00:00:00 2001 From: Ed Avis Date: Wed, 19 May 2010 14:31:11 +0100 Subject: [PATCH] mkstemp returns -1 on failure. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 593f836..e90c396 100644 --- a/main.c +++ b/main.c @@ -154,7 +154,7 @@ static int open_tmpoutfile(void) fatal("Failed to allocate outfile name\n"); fd_out = mkstemp(control.outfile); - if (!fd_out) + if (fd_out == -1) fatal("Failed to create out tmpfile: %s\n", strerror(errno)); return fd_out; } @@ -191,7 +191,7 @@ static int open_tmpinfile(void) fatal("Failed to allocate infile name\n"); fd_in = mkstemp(control.infile); - if (!fd_in) + if (fd_in == -1) fatal("Failed to create in tmpfile: %s\n", strerror(errno)); return fd_in; }