summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Williams <gww@silcom.com>2002-10-24 06:14:19 +0000
committerGeorge Williams <gww@silcom.com>2002-10-24 06:14:19 +0000
commitf0ebaf81fce1544ae3d81a30d66eb11fe7242791 (patch)
tree3f95b5966f2d04c547c365d8d5060a3021d1177c
parent156d4b72e6d6d3180c06d7ae442639149189b08a (diff)
dfont2res didn't work on some dfonts. would produce a bad bin file.
-rw-r--r--Makefile.Mac3
-rw-r--r--dfont2res.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/Makefile.Mac b/Makefile.Mac
index f26ab34..11f1505 100644
--- a/Makefile.Mac
+++ b/Makefile.Mac
@@ -15,9 +15,6 @@ all: fondu ufond showfond dfont2res
fondu: $(FONDUOBJS)
$(CC) $(CFLAGS) -o fondu $(FONDUOBJS) $(CORE)
-res2data: res2data.o
- $(CC) $(CFLAGS) -o res2data res2data.o $(CORE)
-
ufond: $(UFONDOBJS)
$(CC) $(CFLAGS) -o ufond $(UFONDOBJS)
diff --git a/dfont2res.c b/dfont2res.c
index a1da9ea..ec84587 100644
--- a/dfont2res.c
+++ b/dfont2res.c
@@ -138,6 +138,7 @@ static void DumpMacBinaryHeader(FILE *res,struct macbinaryheader *mb) {
static void CopyFile(FILE *out, FILE *in, char *filename) {
struct macbinaryheader header;
char buffer[1024], *pt;
+ unsigned char ubuf[16];
int len, map_pos;
memset(buffer,0,128);
@@ -149,8 +150,8 @@ static void CopyFile(FILE *out, FILE *in, char *filename) {
/* dfonts have a slightly different map header than do resource forks */
/* make the header appropriate for a fork */
rewind(in);
- fread(buffer,1,16,in);
- map_pos = 128 + ((buffer[4]<<24)|(buffer[5]<<16)|(buffer[6]<<8)|buffer[7]);
+ fread(ubuf,1,16,in);
+ map_pos = 128 + ((ubuf[4]<<24)|(ubuf[5]<<16)|(ubuf[6]<<8)|ubuf[7]);
fseek(out,map_pos,SEEK_SET);
fwrite(buffer,1,16,out);