1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

Fix format string warnings

Also fixes bug #768199:

https://bugzilla.gnome.org/show_bug.cgi?id=768199
This commit is contained in:
Nick Wellnhofer 2016-08-22 11:44:18 +02:00
parent c1d1f71211
commit c2545cbb6d
4 changed files with 8 additions and 7 deletions

View File

@ -688,7 +688,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) {
}
if (info.st_size != size) {
fprintf(stderr, "file %s is %ld bytes, result is %d bytes\n",
filename, info.st_size, size);
filename, (long) info.st_size, size);
return(-1);
}
fd = open(filename, RD_FLAGS);

View File

@ -1284,13 +1284,14 @@ saxTest(const char *filename, size_t limit, int options, int fail) {
if (fail)
res = 0;
else {
fprintf(stderr, "Failed to parse '%s' %lu\n", filename, limit);
fprintf(stderr, "Failed to parse '%s' %lu\n", filename,
(unsigned long) limit);
res = 1;
}
} else {
if (fail) {
fprintf(stderr, "Failed to get failure for '%s' %lu\n",
filename, limit);
filename, (unsigned long) limit);
res = 1;
} else
res = 0;
@ -1339,7 +1340,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
filename, crazy_indx);
else
fprintf(stderr, "Failed to parse '%s' %lu\n",
filename, limit);
filename, (unsigned long) limit);
res = 1;
}
} else {
@ -1349,7 +1350,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
filename, crazy_indx);
else
fprintf(stderr, "Failed to get failure for '%s' %lu\n",
filename, limit);
filename, (unsigned long) limit);
res = 1;
} else
res = 0;

View File

@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size)
SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
if (tempstore == NULL)
{
fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", (unsigned long) (sizeof(SORT_TYPE) * new_size));
exit(1);
}
store->storage = tempstore;

View File

@ -1674,7 +1674,7 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) {
xmlStrPrintf(msg, 500,
"xmlZMemBuffExtend: %s %lu bytes.\n",
"Allocation failure extending output buffer to",
new_size );
(unsigned long) new_size );
xmlIOErr(XML_IO_WRITE, (const char *) msg);
}