Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

xmlmemory: add a cast as size_t has no portable printf modifier

Also use %lu as that is more appropriate for size_t.
  • Loading branch information...
commit ecb5d5afdc8acceba608524f6e98c361fd2ce0e9 1 parent a154040
Stefan Sauer ensonic authored

Showing 1 changed file with 7 additions and 4 deletions. Show diff stats Hide diff stats

  1. +7 4 xmlmemory.c
11 xmlmemory.c
@@ -205,7 +205,8 @@ xmlMallocLoc(size_t size, const char * file, int line)
205 205
206 206 if (xmlMemTraceBlockAt == ret) {
207 207 xmlGenericError(xmlGenericErrorContext,
208   - "%p : Malloc(%ld) Ok\n", xmlMemTraceBlockAt, size);
  208 + "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt,
  209 + (long unsigned)size);
209 210 xmlMallocBreakpoint();
210 211 }
211 212
@@ -273,7 +274,8 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
273 274
274 275 if (xmlMemTraceBlockAt == ret) {
275 276 xmlGenericError(xmlGenericErrorContext,
276   - "%p : Malloc(%ld) Ok\n", xmlMemTraceBlockAt, size);
  277 + "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt,
  278 + (long unsigned)size);
277 279 xmlMallocBreakpoint();
278 280 }
279 281
@@ -348,8 +350,9 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
348 350 }
349 351 if (xmlMemTraceBlockAt == ptr) {
350 352 xmlGenericError(xmlGenericErrorContext,
351   - "%p : Realloced(%ld -> %ld) Ok\n",
352   - xmlMemTraceBlockAt, p->mh_size, size);
  353 + "%p : Realloced(%lu -> %lu) Ok\n",
  354 + xmlMemTraceBlockAt, (long unsigned)p->mh_size,
  355 + (long unsigned)size);
353 356 xmlMallocBreakpoint();
354 357 }
355 358 p->mh_tag = MEMTAG;

0 comments on commit ecb5d5a

Please sign in to comment.
Something went wrong with that request. Please try again.