X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjpeg2swf.c;h=b53958a0fe27a1916f6e676cb3ebc00254440c56;hb=ac8c6f00fbaa94b3136457caf1a24d8f4f0c12cc;hp=7c1298f96f8a554f6b429f671135157f7d0dd534;hpb=15771c177b875ca1f233e8aa725283ce1a559091;p=swftools.git diff --git a/src/jpeg2swf.c b/src/jpeg2swf.c index 7c1298f..b53958a 100644 --- a/src/jpeg2swf.c +++ b/src/jpeg2swf.c @@ -136,13 +136,11 @@ int MovieFinish(SWF * swf, TAG * t, char *sname) sname = "output.swf"; handle = open(sname, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666); } - if(global.version >= 6) { - if (swf_WriteSWC(handle, swf)<0) - fprintf(stderr, "Unable to write output file: %s\n", sname); - } else { - if (swf_WriteSWF(handle, swf)<0) - fprintf(stderr, "Unable to write output file: %s\n", sname); + if(handle<0 && sname) { + perror(sname); } + if (swf_WriteSWF(handle, swf)<0) + fprintf(stderr, "Unable to write output file: %s\n", sname); if (handle != so) close(handle);