aboutsummaryrefslogtreecommitdiff
path: root/coreutils/dos2unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/dos2unix.c')
-rw-r--r--coreutils/dos2unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 1d35d524a..04c56ac9c 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -30,7 +30,7 @@ static int convert(char *fn)
30 /* 30 /*
31 The file is then created with mode read/write and 31 The file is then created with mode read/write and
32 permissions 0666 for glibc 2.0.6 and earlier or 32 permissions 0666 for glibc 2.0.6 and earlier or
33 0600 for glibc 2.0.7 and later. 33 0600 for glibc 2.0.7 and later.
34 */ 34 */
35 snprintf(bb_common_bufsiz1, sizeof(bb_common_bufsiz1), "%sXXXXXX", fn); 35 snprintf(bb_common_bufsiz1, sizeof(bb_common_bufsiz1), "%sXXXXXX", fn);
36 /* 36 /*
@@ -38,8 +38,8 @@ static int convert(char *fn)
38 hold the full path. However if the output is truncated the 38 hold the full path. However if the output is truncated the
39 subsequent call to mkstemp would fail. 39 subsequent call to mkstemp would fail.
40 */ 40 */
41 if ((i = mkstemp(&bb_common_bufsiz1[0])) == -1 41 i = mkstemp(&bb_common_bufsiz1[0]);
42 || chmod(bb_common_bufsiz1, 0600) == -1) { 42 if (i == -1 || chmod(bb_common_bufsiz1, 0600) == -1) {
43 bb_perror_nomsg_and_die(); 43 bb_perror_nomsg_and_die();
44 } 44 }
45 out = fdopen(i, "w+"); 45 out = fdopen(i, "w+");