X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2Ffile2include.c;h=b98af30a7281d675a58ba3ebb40f1ddf52f1ee54;hb=25d8380f221ecb6948ea98c2ac67ccc60892efc8;hp=9145f0845ad1016f1e4b559f627e378f7f1544e1;hpb=ab21ecef7a38dd211fe6db35c6e60800445eb6a2;p=u-boot diff --git a/tools/file2include.c b/tools/file2include.c index 9145f0845a..b98af30a72 100644 --- a/tools/file2include.c +++ b/tools/file2include.c @@ -1,10 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Convert a file image to a C define * * Copyright (c) 2017 Heinrich Schuchardt * - * SPDX-License-Identifier: GPL-2.0+ - * * For testing EFI disk management we need an in memory image of * a disk. * @@ -63,12 +62,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); @@ -86,7 +84,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(".");