Mercurial > public > ostc4
changeset 162:ad98da7e74f8 linux-build
OSTC4pack_V4: do not hard code output filename for fonts
... and be a bit more polite. When called without parameters, the
packer simply crashed. Now, print a trivial usage line.
But the real change is, not hard coding the fonts output file name.
This is simply not flexible and inconvenient.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Thu, 21 Feb 2019 10:29:26 +0100 |
parents | b70fae5023b4 |
children | 9c77cfe8c2b2 |
files | ostc4pack/src/OSTC4pack_V4.cpp |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ostc4pack/src/OSTC4pack_V4.cpp Thu Feb 21 10:01:36 2019 +0100 +++ b/ostc4pack/src/OSTC4pack_V4.cpp Thu Feb 21 10:29:26 2019 +0100 @@ -411,6 +411,11 @@ int main(int argc, char** argv) { + if (argc != 3) { + fprintf(stderr, "Usage: OSTC4pack_V4 <type> <bin file>\n"); + return(-1); + } + FILE *fp, * fpout; size_t len; unsigned char buf[1050000]; @@ -440,7 +445,7 @@ sprintf(filenameout,"%s_upload.bin",filename); else if(type == 2) - sprintf(filenameout,"OSTC4_FONT_upload.bin",filename); + sprintf(filenameout,"%s_upload.bin",filename); else sprintf(filenameout,"%s_upload.bin",filename); @@ -513,8 +518,3 @@ fwrite(buf2,sizeof(char),4,fp); } - - - - -