11/*******************************************************************
22 * JPEGoptim
3- * Copyright (c) Timo Kokkonen, 1996-2023 .
3+ * Copyright (c) Timo Kokkonen, 1996-2025 .
44 * All Rights Reserved.
55 *
66 * requires libjpeg (Independent JPEG Group's JPEG software
6464#include "jpegoptim.h"
6565
6666
67- #define VERSION "1.5.5 "
67+ #define VERSION "1.5.6beta "
6868#define COPYRIGHT "Copyright (C) 1996-2023, Timo Kokkonen"
6969
7070#if HAVE_WAIT && HAVE_FORK
@@ -1021,7 +1021,7 @@ int optimize(FILE *log_fh, const char *filename, const char *newname,
10211021 if (copy_file (newname ,tmpfilename ))
10221022 fatal ("%s, failed to create backup: %s" ,
10231023 (stdin_mode ? "stdin" : filename ), tmpfilename );
1024- if ((outfile = fopen (newname , "wb" ))== NULL )
1024+ if ((outfile = create_file (newname ))== NULL )
10251025 fatal ("%s, error opening output file: %s" ,
10261026 (stdin_mode ? "stdin" : filename ), newname );
10271027 outfname = newname ;
@@ -1044,7 +1044,7 @@ int optimize(FILE *log_fh, const char *filename, const char *newname,
10441044 snprintf (tmpfilename ,sizeof (tmpfilename ),
10451045 "%sjpegoptim-%d-%d.%ld.tmp" , tmpdir ,
10461046 (int )getuid (), (int )getpid (), (long )time (NULL ));
1047- if ((outfile = fopen (tmpfilename , "wb" )) == NULL )
1047+ if ((outfile = create_file (tmpfilename )) == NULL )
10481048#endif
10491049 fatal ("error opening temporary file: %s" , tmpfilename );
10501050 outfname = tmpfilename ;
0 commit comments