colibri_imx6: fix video stdout in default environment
[oweals/u-boot.git] / tools / file2include.c
index 7ca45c8339a252129aa538dabc65446ee4948708..775440cba9f1072e558494968b14a05eacd9e184 100644 (file)
@@ -18,7 +18,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <malloc.h>
 
 /* Size of the blocks written to the compressed file */
 #define BLOCK_SIZE 8
@@ -62,12 +61,11 @@ int main(int argc, char *argv[])
        count = fread(buf, 1, count, file);
 
        /* Generate output */
+       printf("/* SPDX-License-Identifier: GPL-2.0+ */\n");
        printf("/*\n");
        printf(" *  Non-zero %u byte strings of a disk image\n", BLOCK_SIZE);
        printf(" *\n");
        printf(" *  Generated with tools/file2include\n");
-       printf(" *\n");
-       printf(" *  SPDX-License-Identifier:    GPL-2.0+\n");
        printf(" */\n\n");
        printf("#define EFI_ST_DISK_IMG { 0x%08zx, { \\\n", count);
 
@@ -85,7 +83,7 @@ int main(int argc, char *argv[])
                        printf("\\x%02x", buf[j]);
                printf("\"}, /* ");
                for (j = i; j < i + BLOCK_SIZE && j < count; ++j) {
-                       if (buf[j] >= 0x20 && buf[j] <= 0x7e)
+                       if (buf[j] != '*' && buf[j] >= 0x20 && buf[j] <= 0x7e)
                                printf("%c", buf[j]);
                        else
                                printf(".");