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:
parent
c1d1f71211
commit
c2545cbb6d
@ -688,7 +688,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) {
|
|||||||
}
|
}
|
||||||
if (info.st_size != size) {
|
if (info.st_size != size) {
|
||||||
fprintf(stderr, "file %s is %ld bytes, result is %d bytes\n",
|
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);
|
return(-1);
|
||||||
}
|
}
|
||||||
fd = open(filename, RD_FLAGS);
|
fd = open(filename, RD_FLAGS);
|
||||||
|
@ -1284,13 +1284,14 @@ saxTest(const char *filename, size_t limit, int options, int fail) {
|
|||||||
if (fail)
|
if (fail)
|
||||||
res = 0;
|
res = 0;
|
||||||
else {
|
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;
|
res = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fail) {
|
if (fail) {
|
||||||
fprintf(stderr, "Failed to get failure for '%s' %lu\n",
|
fprintf(stderr, "Failed to get failure for '%s' %lu\n",
|
||||||
filename, limit);
|
filename, (unsigned long) limit);
|
||||||
res = 1;
|
res = 1;
|
||||||
} else
|
} else
|
||||||
res = 0;
|
res = 0;
|
||||||
@ -1339,7 +1340,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
|
|||||||
filename, crazy_indx);
|
filename, crazy_indx);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Failed to parse '%s' %lu\n",
|
fprintf(stderr, "Failed to parse '%s' %lu\n",
|
||||||
filename, limit);
|
filename, (unsigned long) limit);
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1349,7 +1350,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
|
|||||||
filename, crazy_indx);
|
filename, crazy_indx);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Failed to get failure for '%s' %lu\n",
|
fprintf(stderr, "Failed to get failure for '%s' %lu\n",
|
||||||
filename, limit);
|
filename, (unsigned long) limit);
|
||||||
res = 1;
|
res = 1;
|
||||||
} else
|
} else
|
||||||
res = 0;
|
res = 0;
|
||||||
|
@ -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));
|
SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
|
||||||
if (tempstore == NULL)
|
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);
|
exit(1);
|
||||||
}
|
}
|
||||||
store->storage = tempstore;
|
store->storage = tempstore;
|
||||||
|
2
xmlIO.c
2
xmlIO.c
@ -1674,7 +1674,7 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) {
|
|||||||
xmlStrPrintf(msg, 500,
|
xmlStrPrintf(msg, 500,
|
||||||
"xmlZMemBuffExtend: %s %lu bytes.\n",
|
"xmlZMemBuffExtend: %s %lu bytes.\n",
|
||||||
"Allocation failure extending output buffer to",
|
"Allocation failure extending output buffer to",
|
||||||
new_size );
|
(unsigned long) new_size );
|
||||||
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user