Correct formatting for data and block types in fprintf().

This commit is contained in:
2019-03-18 00:10:58 +00:00
parent 7e5874aaaa
commit 2ca8443fdf

View File

@@ -155,8 +155,7 @@ void *open(const char *filepath)
for(int i = 0; i < idxHeader.entries; i++) for(int i = 0; i < idxHeader.entries; i++)
{ {
fprintf(stderr, fprintf(stderr, "libdicformat: Block type %4.4s with data type %4.4s is indexed to be at %"PRIu64"",
"libdicformat: Block type %4s with data type %4s is indexed to be at %"PRIu64"",
(char *)&idxEntries[i].blockType, (char *)&idxEntries[i].blockType,
(char *)&idxEntries[i].dataType, (char *)&idxEntries[i].dataType,
idxEntries[i].offset); idxEntries[i].offset);
@@ -220,15 +219,14 @@ void *open(const char *filepath)
if(blockHeader.type != idxEntries[i].dataType) if(blockHeader.type != idxEntries[i].dataType)
{ {
fprintf(stderr, fprintf(stderr,
"libdicformat: Expected block with data type %4s at position %"PRIu64" but found data type %4s", "libdicformat: Expected block with data type %4.4s at position %"PRIu64" but found data type %4.4s",
(char *)&idxEntries[i].blockType, (char *)&idxEntries[i].blockType,
idxEntries[i].offset, idxEntries[i].offset,
(char *)&blockHeader.type); (char *)&blockHeader.type);
break; break;
} }
fprintf(stderr, fprintf(stderr, "libdicformat: Found data block with type %4.4s at position %"PRIu64"",
"libdicformat: Found data block with type %4s at position %"PRIu64"",
(char *)&idxEntries[i].blockType, (char *)&idxEntries[i].blockType,
idxEntries[i].offset); idxEntries[i].offset);
@@ -580,7 +578,7 @@ void *open(const char *filepath)
break; break;
default: default:
fprintf(stderr, fprintf(stderr,
"libdicformat: Unhandled block type %4s with data type %4s is indexed to be at %"PRIu64"", "libdicformat: Unhandled block type %4.4s with data type %4.4s is indexed to be at %"PRIu64"",
(char *)&idxEntries[i].blockType, (char *)&idxEntries[i].blockType,
(char *)&idxEntries[i].dataType, (char *)&idxEntries[i].dataType,
idxEntries[i].offset); idxEntries[i].offset);