diff options
| author | Lwisce Zeng <Lwisce.Zeng@garmin.com> | 2024-04-01 15:55:13 +0800 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2024-04-01 11:49:05 -0700 |
| commit | 2ba25b2ddab9aa939c321d087fcfca573a9cca55 (patch) | |
| tree | be7fc649f72cf901225a4a3e6d3c53c6e82d8f41 /contrib | |
| parent | c5e87dcdef72abfb599579bb1b8176948be979c9 (diff) | |
| download | zlib-2ba25b2ddab9aa939c321d087fcfca573a9cca55.tar.gz zlib-2ba25b2ddab9aa939c321d087fcfca573a9cca55.tar.bz2 zlib-2ba25b2ddab9aa939c321d087fcfca573a9cca55.zip | |
Use z_const for setting msg to literal strings.
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/infback9/infback9.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/infback9/infback9.c b/contrib/infback9/infback9.c index 742a392..4ac4c3d 100644 --- a/contrib/infback9/infback9.c +++ b/contrib/infback9/infback9.c | |||
| @@ -293,7 +293,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 293 | mode = TABLE; | 293 | mode = TABLE; |
| 294 | break; | 294 | break; |
| 295 | case 3: | 295 | case 3: |
| 296 | strm->msg = (char *)"invalid block type"; | 296 | strm->msg = (z_const char *)"invalid block type"; |
| 297 | mode = BAD; | 297 | mode = BAD; |
| 298 | } | 298 | } |
| 299 | DROPBITS(2); | 299 | DROPBITS(2); |
| @@ -304,7 +304,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 304 | BYTEBITS(); /* go to byte boundary */ | 304 | BYTEBITS(); /* go to byte boundary */ |
| 305 | NEEDBITS(32); | 305 | NEEDBITS(32); |
| 306 | if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { | 306 | if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { |
| 307 | strm->msg = (char *)"invalid stored block lengths"; | 307 | strm->msg = (z_const char *)"invalid stored block lengths"; |
| 308 | mode = BAD; | 308 | mode = BAD; |
| 309 | break; | 309 | break; |
| 310 | } | 310 | } |
| @@ -341,7 +341,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 341 | state->ncode = BITS(4) + 4; | 341 | state->ncode = BITS(4) + 4; |
| 342 | DROPBITS(4); | 342 | DROPBITS(4); |
| 343 | if (state->nlen > 286) { | 343 | if (state->nlen > 286) { |
| 344 | strm->msg = (char *)"too many length symbols"; | 344 | strm->msg = (z_const char *)"too many length symbols"; |
| 345 | mode = BAD; | 345 | mode = BAD; |
| 346 | break; | 346 | break; |
| 347 | } | 347 | } |
| @@ -362,7 +362,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 362 | ret = inflate_table9(CODES, state->lens, 19, &(state->next), | 362 | ret = inflate_table9(CODES, state->lens, 19, &(state->next), |
| 363 | &(lenbits), state->work); | 363 | &(lenbits), state->work); |
| 364 | if (ret) { | 364 | if (ret) { |
| 365 | strm->msg = (char *)"invalid code lengths set"; | 365 | strm->msg = (z_const char *)"invalid code lengths set"; |
| 366 | mode = BAD; | 366 | mode = BAD; |
| 367 | break; | 367 | break; |
| 368 | } | 368 | } |
| @@ -386,7 +386,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 386 | NEEDBITS(here.bits + 2); | 386 | NEEDBITS(here.bits + 2); |
| 387 | DROPBITS(here.bits); | 387 | DROPBITS(here.bits); |
| 388 | if (state->have == 0) { | 388 | if (state->have == 0) { |
| 389 | strm->msg = (char *)"invalid bit length repeat"; | 389 | strm->msg = (z_const char *)"invalid bit length repeat"; |
| 390 | mode = BAD; | 390 | mode = BAD; |
| 391 | break; | 391 | break; |
| 392 | } | 392 | } |
| @@ -409,7 +409,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 409 | DROPBITS(7); | 409 | DROPBITS(7); |
| 410 | } | 410 | } |
| 411 | if (state->have + copy > state->nlen + state->ndist) { | 411 | if (state->have + copy > state->nlen + state->ndist) { |
| 412 | strm->msg = (char *)"invalid bit length repeat"; | 412 | strm->msg = (z_const char *)"invalid bit length repeat"; |
| 413 | mode = BAD; | 413 | mode = BAD; |
| 414 | break; | 414 | break; |
| 415 | } | 415 | } |
| @@ -423,7 +423,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 423 | 423 | ||
| 424 | /* check for end-of-block code (better have one) */ | 424 | /* check for end-of-block code (better have one) */ |
| 425 | if (state->lens[256] == 0) { | 425 | if (state->lens[256] == 0) { |
| 426 | strm->msg = (char *)"invalid code -- missing end-of-block"; | 426 | strm->msg = (z_const char *)"invalid code -- missing end-of-block"; |
| 427 | mode = BAD; | 427 | mode = BAD; |
| 428 | break; | 428 | break; |
| 429 | } | 429 | } |
| @@ -437,7 +437,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 437 | ret = inflate_table9(LENS, state->lens, state->nlen, | 437 | ret = inflate_table9(LENS, state->lens, state->nlen, |
| 438 | &(state->next), &(lenbits), state->work); | 438 | &(state->next), &(lenbits), state->work); |
| 439 | if (ret) { | 439 | if (ret) { |
| 440 | strm->msg = (char *)"invalid literal/lengths set"; | 440 | strm->msg = (z_const char *)"invalid literal/lengths set"; |
| 441 | mode = BAD; | 441 | mode = BAD; |
| 442 | break; | 442 | break; |
| 443 | } | 443 | } |
| @@ -447,7 +447,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 447 | state->ndist, &(state->next), &(distbits), | 447 | state->ndist, &(state->next), &(distbits), |
| 448 | state->work); | 448 | state->work); |
| 449 | if (ret) { | 449 | if (ret) { |
| 450 | strm->msg = (char *)"invalid distances set"; | 450 | strm->msg = (z_const char *)"invalid distances set"; |
| 451 | mode = BAD; | 451 | mode = BAD; |
| 452 | break; | 452 | break; |
| 453 | } | 453 | } |
| @@ -495,7 +495,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 495 | 495 | ||
| 496 | /* invalid code */ | 496 | /* invalid code */ |
| 497 | if (here.op & 64) { | 497 | if (here.op & 64) { |
| 498 | strm->msg = (char *)"invalid literal/length code"; | 498 | strm->msg = (z_const char *)"invalid literal/length code"; |
| 499 | mode = BAD; | 499 | mode = BAD; |
| 500 | break; | 500 | break; |
| 501 | } | 501 | } |
| @@ -527,7 +527,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 527 | } | 527 | } |
| 528 | DROPBITS(here.bits); | 528 | DROPBITS(here.bits); |
| 529 | if (here.op & 64) { | 529 | if (here.op & 64) { |
| 530 | strm->msg = (char *)"invalid distance code"; | 530 | strm->msg = (z_const char *)"invalid distance code"; |
| 531 | mode = BAD; | 531 | mode = BAD; |
| 532 | break; | 532 | break; |
| 533 | } | 533 | } |
| @@ -541,7 +541,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, | |||
| 541 | DROPBITS(extra); | 541 | DROPBITS(extra); |
| 542 | } | 542 | } |
| 543 | if (offset > WSIZE - (wrap ? 0: left)) { | 543 | if (offset > WSIZE - (wrap ? 0: left)) { |
| 544 | strm->msg = (char *)"invalid distance too far back"; | 544 | strm->msg = (z_const char *)"invalid distance too far back"; |
| 545 | mode = BAD; | 545 | mode = BAD; |
| 546 | break; | 546 | break; |
| 547 | } | 547 | } |
