]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove const qualifier from modified strings 2969/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 20 Apr 2026 15:44:46 +0000 (17:44 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 9 May 2026 10:21:27 +0000 (12:21 +0200)
Strings pointed to by these variables are actually modified. They point
to modifiable data areas (own stack arrays or argv arguments), so the
code does not erroneously modify them. Instead, clarify that they are
modifiable by removing the qualifier.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/test/test_write_format_mtree.c
tar/bsdtar.h

index ed065f9c13400287d50eabdcd239fc93eabf3cb9..907e291f2f55a083350f075a867524d7f57d2abe 100644 (file)
@@ -109,7 +109,7 @@ test_write_format_mtree_sub(int use_set, int dironly)
         assertEqualInt(ARCHIVE_OK, archive_write_free(a));
 
        if (use_set) {
-               const char *p;
+               char *p;
 
                buff[used] = '\0';
                assert(NULL != (p = strstr(buff, "\n/set ")));
@@ -197,7 +197,7 @@ test_write_format_mtree_sub2(int use_set, int dironly)
         assertEqualInt(ARCHIVE_OK, archive_write_free(a));
 
   if (use_set) {
-    const char *p;
+    char *p;
 
     buff[used] = '\0';
     assert(NULL != (p = strstr(buff, "\n/set ")));
index 782d36d6f75620f1bf1ae2f725417d9e48093aaf..692b800bf811b29361b925212c92419da03799bd 100644 (file)
@@ -67,7 +67,7 @@ struct bsdtar {
        /* Miscellaneous state information */
        int               argc;
        char            **argv;
-       const char       *argument;
+       char             *argument;
        size_t            gs_width; /* For 'list_item' in read.c */
        size_t            u_width; /* for 'list_item' in read.c */
        uid_t             user_uid; /* UID running this program */