Mercurial > hg > dmlib
comparison src/dmzlib.c @ 2384:36edd316184a
Fix some format strings to use proper PRI*_SIZE_T where necessary.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 09 Jan 2020 15:20:23 +0200 |
parents | 749f8f808531 |
children | 69a5af2eb1ea |
comparison
equal
deleted
inserted
replaced
2383:43e39d9ec42f | 2384:36edd316184a |
---|---|
495 | 495 |
496 | 496 |
497 static int dmZLibParseUncompressedBlock(DMZLibContext * ctx) | 497 static int dmZLibParseUncompressedBlock(DMZLibContext * ctx) |
498 { | 498 { |
499 Uint8 header[4]; | 499 Uint8 header[4]; |
500 size_t len, nlen, k, ret; | 500 size_t len, nlen, k; |
501 | 501 |
502 // "Any bits of input up to the next byte boundary are ignored." | 502 // "Any bits of input up to the next byte boundary are ignored." |
503 if (ctx->numBits & 7) | 503 if (ctx->numBits & 7) |
504 dmZReceive(ctx, ctx->numBits & 7); | 504 dmZReceive(ctx, ctx->numBits & 7); |
505 | 505 |
521 nlen = (header[3] << 8) | header[2]; | 521 nlen = (header[3] << 8) | header[2]; |
522 | 522 |
523 if (nlen != (len ^ 0xffff)) | 523 if (nlen != (len ^ 0xffff)) |
524 { | 524 { |
525 return dmErrorDBG(DMERR_DATA_ERROR, | 525 return dmErrorDBG(DMERR_DATA_ERROR, |
526 "Compressed data corrupt %04x :: %04x [%04x].\n", | 526 "Compressed data corrupt %04" DM_PRIx_SIZE_T |
527 " :: %04" DM_PRIx_SIZE_T " [%04" DM_PRIx_SIZE_T "].\n", | |
527 nlen, len, len ^ 0xffff); | 528 nlen, len, len ^ 0xffff); |
528 } | 529 } |
529 | 530 |
530 if (len > 0) | 531 if (len > 0) |
531 { | 532 { |
533 int ret; | |
534 | |
532 if (ctx->inBuffer + len > ctx->inBufferEnd) | 535 if (ctx->inBuffer + len > ctx->inBufferEnd) |
533 { | 536 { |
534 return dmErrorDBG(DMERR_BOUNDS, | 537 return dmErrorDBG(DMERR_BOUNDS, |
535 "Read past buffer, probably corrupt compressed data.\n"); | 538 "Read past buffer, probably corrupt compressed data.\n"); |
536 } | 539 } |