diff options
Diffstat (limited to 'release/datafiles/datatoc.c')
-rw-r--r-- | release/datafiles/datatoc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/release/datafiles/datatoc.c b/release/datafiles/datatoc.c index 75f789b378a..2e24a0f92ef 100644 --- a/release/datafiles/datatoc.c +++ b/release/datafiles/datatoc.c @@ -62,7 +62,7 @@ int main(int argc, char**argv) { if (argv[1][i]=='.') argv[1][i]='_'; sprintf(sizest, "%d", (int)size); - printf ("Input filesize is %d, Output size should be %d\n", size, ((int)size)*4 + strlen("/* DataToC output of file <> */\n\n") + strlen("char datatoc_[]= {\"") + strlen ("\"};\n") + (strlen(argv[1])*3) + strlen(sizest) + strlen("int datatoc__size= ;\n") +(((int)(size/256)+1)*5)); + printf ("Input filesize is %ld, Output size should be %ld\n", size, ((int)size)*4 + strlen("/* DataToC output of file <> */\n\n") + strlen("char datatoc_[]= {\"") + strlen ("\"};\n") + (strlen(argv[1])*3) + strlen(sizest) + strlen("int datatoc__size= ;\n") +(((int)(size/256)+1)*5)); fpout= fopen(cname, "w"); if (!fpout) { @@ -93,8 +93,8 @@ int main(int argc, char**argv) { /* fprintf (fpout, "\\x%02x", getc(fpin)); */ fprintf (fpout, "%3d,", getc(fpin)); } - - fprintf (fpout, "\n};\n\n"); + /* null terminate for the case it is a string */ + fprintf (fpout, "\n 0};\n\n"); fclose(fpin); fclose(fpout); |