swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] Small bug in swfcombine.c (incl. patch)


From: Oliver Smith
Subject: [Swftools-common] Small bug in swfcombine.c (incl. patch)
Date: Wed, 4 Aug 2010 14:33:11 +0100

First off, thanks to the developers of swftools for such a useful set of 
utilities!

I've found a small bug in swfcombine.c -- it's not correctly checking the 
return value from open(), so occasionally it will complain that it's unable to 
open a file, even if it's successfully opened it.

Patch for the fix below.  This was a real head-scratcher to track down.  Hope 
it's useful!

Thanks,

Olly Smith


diff -uNr src/src/swfcombine.c srcp/src/swfcombine.c
--- src/src/swfcombine.c        2010-04-03 20:34:42.000000000 +0100
+++ srcp/src/swfcombine.c       2010-08-04 10:11:40.000000000 +0100
@@ -1332,7 +1332,7 @@
            {
                int ret;
                fi = open(slave_filename[t], O_RDONLY|O_BINARY);
-               if(!fi) {
+               if(fi<0) {
                    msg("<fatal> Failed to open %s\n", slave_filename[t]);
                    exit(1);
                }


--
projectfusion.com | tel +44 (0) 20 7739 4252
UNDISCLAIMER - We mean everything we write in our emails. 
PROJECTFUSION - Security and Simplicity™




reply via email to

[Prev in Thread] Current Thread [Next in Thread]