aboutsummaryrefslogtreecommitdiff
path: root/infback.c
diff options
context:
space:
mode:
authorLwisce Zeng <Lwisce.Zeng@garmin.com>2024-04-01 15:55:13 +0800
committerMark Adler <madler@alumni.caltech.edu>2024-04-01 11:49:05 -0700
commit2ba25b2ddab9aa939c321d087fcfca573a9cca55 (patch)
treebe7fc649f72cf901225a4a3e6d3c53c6e82d8f41 /infback.c
parentc5e87dcdef72abfb599579bb1b8176948be979c9 (diff)
downloadzlib-2ba25b2ddab9aa939c321d087fcfca573a9cca55.tar.gz
zlib-2ba25b2ddab9aa939c321d087fcfca573a9cca55.tar.bz2
zlib-2ba25b2ddab9aa939c321d087fcfca573a9cca55.zip
Use z_const for setting msg to literal strings.
Diffstat (limited to 'infback.c')
-rw-r--r--infback.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/infback.c b/infback.c
index e7b25b3..fd02e70 100644
--- a/infback.c
+++ b/infback.c
@@ -304,7 +304,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
304 state->mode = TABLE; 304 state->mode = TABLE;
305 break; 305 break;
306 case 3: 306 case 3:
307 strm->msg = (char *)"invalid block type"; 307 strm->msg = (z_const char *)"invalid block type";
308 state->mode = BAD; 308 state->mode = BAD;
309 } 309 }
310 DROPBITS(2); 310 DROPBITS(2);
@@ -315,7 +315,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
315 BYTEBITS(); /* go to byte boundary */ 315 BYTEBITS(); /* go to byte boundary */
316 NEEDBITS(32); 316 NEEDBITS(32);
317 if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { 317 if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
318 strm->msg = (char *)"invalid stored block lengths"; 318 strm->msg = (z_const char *)"invalid stored block lengths";
319 state->mode = BAD; 319 state->mode = BAD;
320 break; 320 break;
321 } 321 }
@@ -353,7 +353,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
353 DROPBITS(4); 353 DROPBITS(4);
354#ifndef PKZIP_BUG_WORKAROUND 354#ifndef PKZIP_BUG_WORKAROUND
355 if (state->nlen > 286 || state->ndist > 30) { 355 if (state->nlen > 286 || state->ndist > 30) {
356 strm->msg = (char *)"too many length or distance symbols"; 356 strm->msg = (z_const char *)"too many length or distance symbols";
357 state->mode = BAD; 357 state->mode = BAD;
358 break; 358 break;
359 } 359 }
@@ -375,7 +375,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
375 ret = inflate_table(CODES, state->lens, 19, &(state->next), 375 ret = inflate_table(CODES, state->lens, 19, &(state->next),
376 &(state->lenbits), state->work); 376 &(state->lenbits), state->work);
377 if (ret) { 377 if (ret) {
378 strm->msg = (char *)"invalid code lengths set"; 378 strm->msg = (z_const char *)"invalid code lengths set";
379 state->mode = BAD; 379 state->mode = BAD;
380 break; 380 break;
381 } 381 }
@@ -398,7 +398,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
398 NEEDBITS(here.bits + 2); 398 NEEDBITS(here.bits + 2);
399 DROPBITS(here.bits); 399 DROPBITS(here.bits);
400 if (state->have == 0) { 400 if (state->have == 0) {
401 strm->msg = (char *)"invalid bit length repeat"; 401 strm->msg = (z_const char *)"invalid bit length repeat";
402 state->mode = BAD; 402 state->mode = BAD;
403 break; 403 break;
404 } 404 }
@@ -421,7 +421,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
421 DROPBITS(7); 421 DROPBITS(7);
422 } 422 }
423 if (state->have + copy > state->nlen + state->ndist) { 423 if (state->have + copy > state->nlen + state->ndist) {
424 strm->msg = (char *)"invalid bit length repeat"; 424 strm->msg = (z_const char *)"invalid bit length repeat";
425 state->mode = BAD; 425 state->mode = BAD;
426 break; 426 break;
427 } 427 }
@@ -435,7 +435,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
435 435
436 /* check for end-of-block code (better have one) */ 436 /* check for end-of-block code (better have one) */
437 if (state->lens[256] == 0) { 437 if (state->lens[256] == 0) {
438 strm->msg = (char *)"invalid code -- missing end-of-block"; 438 strm->msg = (z_const char *)"invalid code -- missing end-of-block";
439 state->mode = BAD; 439 state->mode = BAD;
440 break; 440 break;
441 } 441 }
@@ -449,7 +449,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
449 ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), 449 ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
450 &(state->lenbits), state->work); 450 &(state->lenbits), state->work);
451 if (ret) { 451 if (ret) {
452 strm->msg = (char *)"invalid literal/lengths set"; 452 strm->msg = (z_const char *)"invalid literal/lengths set";
453 state->mode = BAD; 453 state->mode = BAD;
454 break; 454 break;
455 } 455 }
@@ -458,7 +458,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
458 ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, 458 ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
459 &(state->next), &(state->distbits), state->work); 459 &(state->next), &(state->distbits), state->work);
460 if (ret) { 460 if (ret) {
461 strm->msg = (char *)"invalid distances set"; 461 strm->msg = (z_const char *)"invalid distances set";
462 state->mode = BAD; 462 state->mode = BAD;
463 break; 463 break;
464 } 464 }
@@ -517,7 +517,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
517 517
518 /* invalid code */ 518 /* invalid code */
519 if (here.op & 64) { 519 if (here.op & 64) {
520 strm->msg = (char *)"invalid literal/length code"; 520 strm->msg = (z_const char *)"invalid literal/length code";
521 state->mode = BAD; 521 state->mode = BAD;
522 break; 522 break;
523 } 523 }
@@ -549,7 +549,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
549 } 549 }
550 DROPBITS(here.bits); 550 DROPBITS(here.bits);
551 if (here.op & 64) { 551 if (here.op & 64) {
552 strm->msg = (char *)"invalid distance code"; 552 strm->msg = (z_const char *)"invalid distance code";
553 state->mode = BAD; 553 state->mode = BAD;
554 break; 554 break;
555 } 555 }
@@ -564,7 +564,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
564 } 564 }
565 if (state->offset > state->wsize - (state->whave < state->wsize ? 565 if (state->offset > state->wsize - (state->whave < state->wsize ?
566 left : 0)) { 566 left : 0)) {
567 strm->msg = (char *)"invalid distance too far back"; 567 strm->msg = (z_const char *)"invalid distance too far back";
568 state->mode = BAD; 568 state->mode = BAD;
569 break; 569 break;
570 } 570 }