Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed variable scope of tmpfd that causing compilation error in main() #55

Merged
merged 1 commit into from
Dec 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixing variable scope of tmpfd that causing compilation error
  • Loading branch information
cry0this committed Nov 2, 2017
commit 06ad7d3398feb12cc07dbea4e80265595b9ecdbe
7 changes: 4 additions & 3 deletions jpegoptim.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* requires libjpeg (Independent JPEG Group's JPEG software
* release 6a or later...)
*
* $Id: b5d97f2a4d2b8196ca662c8dd0bedffb8d3fbe71 $
* $Id$
*/

#ifdef HAVE_CONFIG_H
Expand Down Expand Up @@ -56,7 +56,7 @@ struct my_error_mgr {
};
typedef struct my_error_mgr * my_error_ptr;

const char *rcsid = "$Id: b5d97f2a4d2b8196ca662c8dd0bedffb8d3fbe71 $";
const char *rcsid = "$Id$";


int verbose_mode = 0;
Expand Down Expand Up @@ -828,7 +828,8 @@ int main(int argc, char **argv)
/* rely on mkstemps() to create us temporary file safely... */
snprintf(tmpfilename,sizeof(tmpfilename),
"%sjpegoptim-%d-%d.XXXXXX.tmp", tmpdir, (int)getuid(), (int)getpid());
if ((int tmpfd = mkstemps(tmpfilename,4)) < 0)
int tmpfd = mkstemps(tmpfilename,4);
if (tmpfd < 0)
fatal("%s, error creating temp file %s: mkstemps() failed",(stdin_mode?"stdin":argv[i]),tmpfilename);
if ((outfile=fdopen(tmpfd,"wb"))==NULL)
#else
Expand Down