Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/datafiles/datatoc.c')
-rw-r--r--release/datafiles/datatoc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/release/datafiles/datatoc.c b/release/datafiles/datatoc.c
index 75f789b378a..46b935c7fd6 100644
--- a/release/datafiles/datatoc.c
+++ b/release/datafiles/datatoc.c
@@ -35,7 +35,7 @@ int main(int argc, char**argv) {
FILE *fpin, *fpout;
char cname[256];
char sizest[256];
- long size;
+ size_t size;
int i;
if (argc<1) {
@@ -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);