Bugfix
authorMatthew Mondor <mmondor@pulsar-zone.net>
Wed, 25 Jun 2014 07:38:26 +0000 (07:38 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Wed, 25 Jun 2014 07:38:26 +0000 (07:38 +0000)
mmsoftware/util/file-to-c.c

index 3eb9053..e443831 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: file-to-c.c,v 1.1 2014/06/25 06:13:19 mmondor Exp $ */
+/* $Id: file-to-c.c,v 1.2 2014/06/25 07:38:26 mmondor Exp $ */
 
 /*
  * Copyright (c) 2014, Matthew Mondor
@@ -74,8 +74,8 @@ main(int argc, char **argv)
 #include <stddef.h>\n\
 #include <stdint.h>\n\
 \n\
-const uint8_t\tstatic_%s_data[] = {\n\
-       ", symbol);
+const uint8_t\tstatic_%s_data[%ld] = {\n\
+       ", symbol, size);
        for (i = 0, count = 1; ; i++, count++) {
                uint8_t b;
 
@@ -103,10 +103,10 @@ const size_t\tstatic_%s_size = %ld;\n\n", symbol, size);
 #ifndef _STATIC_%s_\n\
 #define _STATIC_%s_\n\
 \n\
-extern const uint8_t\t*static_%s_data;\n\
+extern const uint8_t\tstatic_%s_data[%ld];\n\
 extern const size_t\tstatic_%s_size;\n\
 \n\
-#endif\n\n", symbol2, symbol2, symbol, symbol);
+#endif\n\n", symbol2, symbol2, symbol, size, symbol);
        (void) fclose(fht);
 
        exit(EXIT_SUCCESS);