tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.56k stars 116 forks source link

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

Closed cry0this closed 6 years ago

cry0this commented 6 years ago

Last moving of tmpfd is leading to compilation error because exiting of current scope. I moved declaration of tmpfd up to previous string.

ghost commented 6 years ago

Strange. GCC compiles for me without errors. What compiler are you using?

I see why you would move it up though... I'm a little surprised it compiled on my machine.

travisbell commented 6 years ago

I also had this error, this patch fixes it. This is on OS X.

ghost commented 6 years ago

Tried it on a few different machines with GCC, no change in behavior, no compilation errors.

But yeah, the variable ceases to exist after the if-statement. Compiling this patch works properly. I'll investigate this a little more as to why GCC is compiling without errors.

Oh man and that error was my mistake too, fml.