From: dseg Date: Thu, 2 Jun 2005 04:57:06 +0000 (+0000) Subject: Outputed swf was corrupt on Windows X-Git-Tag: release-0-7-0~62 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=6a12223ff824872fd1c8e35ea01f134b5664430f Outputed swf was corrupt on Windows --- diff --git a/lib/example/box.c b/lib/example/box.c index 0e7caa1..3fbedcb 100644 --- a/lib/example/box.c +++ b/lib/example/box.c @@ -304,7 +304,7 @@ int main (int argc,char ** argv) // swf_WriteCGI(&swf); - f = open("box.swf",O_RDWR|O_CREAT|O_TRUNC,0644); + f = open("box.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/buttontest.c b/lib/example/buttontest.c index 9f9f41b..76ba207 100644 --- a/lib/example/buttontest.c +++ b/lib/example/buttontest.c @@ -132,7 +132,7 @@ int main (int argc,char ** argv) t = swf_InsertTag(t,ST_SHOWFRAME); t = swf_InsertTag(t,ST_END); - f = open("buttontest.swf",O_WRONLY|O_CREAT, 0644); + f = open("buttontest.swf",O_WRONLY|O_CREAT|O_BINARY, 0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/edittext.c b/lib/example/edittext.c index 463b888..19b04a4 100644 --- a/lib/example/edittext.c +++ b/lib/example/edittext.c @@ -121,7 +121,7 @@ int main (int argc,char ** argv) tag = swf_InsertTag(tag,ST_SHOWFRAME); tag = swf_InsertTag(tag,ST_END); - f = open("edittext.swf",O_WRONLY|O_CREAT|O_TRUNC, 0644); + f = open("edittext.swf",O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644); if(swf_WriteSWF(f,&swf)<0) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/glyphshape.c b/lib/example/glyphshape.c index c7e16f6..d1e8d01 100644 --- a/lib/example/glyphshape.c +++ b/lib/example/glyphshape.c @@ -157,7 +157,7 @@ int main(int argc, char ** argv) // swf_WriteCGI(&swf); - f = open("glyphshape.swf",O_RDWR|O_CREAT|O_TRUNC,0644); + f = open("glyphshape.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/jpegtest.c b/lib/example/jpegtest.c index 3931814..4e195d9 100644 --- a/lib/example/jpegtest.c +++ b/lib/example/jpegtest.c @@ -148,7 +148,7 @@ int main( int argc, char ** argv) // swf_WriteCGI(&swf); - f = open("jpegtest.swf",O_WRONLY|O_CREAT, 0644); + f = open("jpegtest.swf",O_WRONLY|O_CREAT||O_BINARY, 0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/shape1.c b/lib/example/shape1.c index a65d0e4..2520ce1 100644 --- a/lib/example/shape1.c +++ b/lib/example/shape1.c @@ -103,7 +103,7 @@ int main (int argc,char ** argv) // write movie to file - f = open("shape1.swf",O_WRONLY|O_CREAT|O_TRUNC, 0644); + f = open("shape1.swf",O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/sound.c b/lib/example/sound.c index 2c0d892..de86113 100644 --- a/lib/example/sound.c +++ b/lib/example/sound.c @@ -70,7 +70,7 @@ int main (int argc,char ** argv) tag = swf_InsertTag(tag, ST_END); - f = open("sound.swf",O_WRONLY|O_CREAT|O_TRUNC, 0644); + f = open("sound.swf",O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/sprites.c b/lib/example/sprites.c index 7c97c3c..569eca3 100644 --- a/lib/example/sprites.c +++ b/lib/example/sprites.c @@ -158,7 +158,7 @@ int main(int argc, char ** argv) // swf_WriteCGI(&swf); - f = open("sprites.swf",O_RDWR|O_CREAT|O_TRUNC,0644); + f = open("sprites.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/text.c b/lib/example/text.c index 6bfe13a..d684c0e 100644 --- a/lib/example/text.c +++ b/lib/example/text.c @@ -142,7 +142,7 @@ int main(int argc, char ** argv) // swf_WriteCGI(&swf); - f = open("text.swf",O_RDWR|O_CREAT|O_TRUNC,0644); + f = open("text.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/transtest.c b/lib/example/transtest.c index 56f5180..0e835be 100644 --- a/lib/example/transtest.c +++ b/lib/example/transtest.c @@ -151,7 +151,7 @@ int main (int argc,char ** argv) // swf_WriteCGI(&swf); - f = open("transtest.swf",O_RDWR|O_CREAT|O_TRUNC,0644); + f = open("transtest.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f); diff --git a/lib/example/zlibtest.c b/lib/example/zlibtest.c index 967f861..816f17d 100644 --- a/lib/example/zlibtest.c +++ b/lib/example/zlibtest.c @@ -199,7 +199,7 @@ int main ( int argc, char ** argv) // swf_WriteCGI(&swf); - f = open("zlibtest.swf",O_RDWR|O_CREAT|O_TRUNC,0644); + f = open("zlibtest.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644); if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n"); close(f);