X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fexample%2Fprotect.c;h=684bc6dac0c3ed2aad97e0f8330018d266733bf0;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=75a0ea8f8944b530e56149de2110064fd90497e8;hpb=b5a1b15e0160b0ee1ff8fa0ecf770b30fbced560;p=swftools.git diff --git a/lib/example/protect.c b/lib/example/protect.c index 75a0ea8..684bc6d 100644 --- a/lib/example/protect.c +++ b/lib/example/protect.c @@ -37,7 +37,7 @@ int main(int argn,char ** argv) return 0; } - fi = open(argv[1],O_RDONLY); + fi = open(argv[1],O_RDONLY|O_BINARY); if (fi<=0) { @@ -62,7 +62,7 @@ int main(int argn,char ** argv) if(!ret) printf("Password validation failed\n"); else printf("Password ok\n"); - swf_DeleteTag(tag); + swf_DeleteTag(&swf, tag); } tag = next; } @@ -74,10 +74,8 @@ int main(int argn,char ** argv) if(fi<0) { fprintf(stderr, "couldn't create output file %s", outfilename); } - if(swf.compressed) - {if(swf_WriteSWC(fi, &swf)<0) fprintf(stderr, "WriteSWC() failed.\n");} - else - {if(swf_WriteSWF(fi, &swf)<0) fprintf(stderr, "WriteSWF() failed.\n");} + if(swf_WriteSWF(fi, &swf)<0) + fprintf(stderr, "WriteSWF() failed.\n"); close(fi);