# HG changeset patch # User Jan Mulder # Date 1550741366 -3600 # Node ID ad98da7e74f850de0d7e57754f07542521319155 # Parent b70fae5023b4e254596192cd1edba41096cc4fda 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 diff -r b70fae5023b4 -r ad98da7e74f8 ostc4pack/src/OSTC4pack_V4.cpp --- 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 \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); } - - - - -