public inbox for bzip2-devel@sourceware.org
 help / color / mirror / Atom feed
* Declare bzerrorstrings[] to be a const object.
@ 2022-04-26 14:33 Carlo Bramini
  2022-04-26 19:35 ` Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Bramini @ 2022-04-26 14:33 UTC (permalink / raw)
  To: bzip2-devel

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

Hello,
by looking the content of the map file, I discovered that bzerrorstrings[] is not const.
So, I would like to suggest the tiny change into the attached patch, for declaring both bzerrorstrings[] and the addressed strings as const.
The patch has been created from the latest sources into the repository with GIT.

Sincerely,

Carlo Bramini.

[-- Attachment #2: bzlib.c.patch --]
[-- Type: application/octet-stream, Size: 337 bytes --]

diff --git a/bzlib.c b/bzlib.c
index 2178655..752d5a0 100644
--- a/bzlib.c
+++ b/bzlib.c
@@ -1536,7 +1536,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b)
 /*--
    return last error code 
 --*/
-static const char *bzerrorstrings[] = {
+static const char * const bzerrorstrings[] = {
        "OK"
       ,"SEQUENCE_ERROR"
       ,"PARAM_ERROR"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-27  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 14:33 Declare bzerrorstrings[] to be a const object Carlo Bramini
2022-04-26 19:35 ` Mark Wielaard
2022-04-27  9:21   ` Carlo Bramini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).