From 605c4e2431910b6b996453272d6d88d57c1a3614 Mon Sep 17 00:00:00 2001 From: hackbard Date: Thu, 13 Sep 2007 14:09:56 +0200 Subject: [PATCH] fixed binary writing --- betty/font2b.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/betty/font2b.c b/betty/font2b.c index 6c1af61..fd88252 100644 --- a/betty/font2b.c +++ b/betty/font2b.c @@ -40,7 +40,7 @@ int main(int argc,char **argv) { stat=CHAR; if(argc==2) { - fd=open(argv[1],O_WRONLY); + fd=open(argv[1],O_WRONLY|O_CREAT); if(fd<0) { perror("file open"); return fd; @@ -54,11 +54,13 @@ int main(int argc,char **argv) { for(font=0;font<=0xff;font++) { /* print the font number */ - printf("\t/* %d 0x%02x",font,font); - if((font>0x1f)&(font<0x7f)) - printf(" %c */\n",font); - else - printf(" */\n"); + if(stat==CHAR) { + printf("\t/* %d 0x%02x",font,font); + if((font>0x1f)&(font<0x7f)) + printf(" %c */\n",font); + else + printf(" */\n"); + } /* print the array content of the font */ for(col=0;col<8;col++) { -- 2.20.1