From: kramm <kramm>
Date: Wed, 22 Sep 2004 11:43:07 +0000 (+0000)
Subject: swf_WriteFont/swf_ReadFont now also work on Windows.
X-Git-Tag: release-0-6-2~30
X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=ac58a40c594fa441eb4192cc4c86068372a7f18e;p=swftools.git

swf_WriteFont/swf_ReadFont now also work on Windows.
---

diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c
index a01e10b..b0d3de5 100644
--- a/lib/modules/swftext.c
+++ b/lib/modules/swftext.c
@@ -1187,7 +1187,7 @@ SWFFONT *swf_ReadFont(char *filename)
     SWF swf;
     if (!filename)
 	return 0;
-    f = open(filename, O_RDONLY);
+    f = open(filename, O_RDONLY|O_BINARY);
 
     if (f < 0 || swf_ReadSWF(f, &swf) < 0) {
 	fprintf(stderr, "%s is not a valid SWF font file or contains errors.\n", filename);
@@ -1360,7 +1360,7 @@ void swf_WriteFont(SWFFONT * font, char *filename)
 
     t = swf_InsertTag(t, ST_END);
 
-    f = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0644);
+    f = open(filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0644);
     if FAILED
 	(swf_WriteSWF(f, &swf)) fprintf(stderr, "WriteSWF() failed in writeFont().\n");
     close(f);