From: Tobias Stoeckmann Date: Tue, 7 Jul 2026 15:12:58 +0000 (+0200) Subject: options: Use const char pointer where possible X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68ccc129a8a3f73a47324ed2b566be567c23736d;p=thirdparty%2Flibarchive.git options: Use const char pointer where possible If referenced strings are not modified, use const char pointer. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_options.c b/libarchive/archive_options.c index 6190bb8ef..24480b97e 100644 --- a/libarchive/archive_options.c +++ b/libarchive/archive_options.c @@ -33,7 +33,7 @@ static char * parse_option(char **str, - char **mod, char **opt, char **val); + const char **mod, const char **opt, const char **val); int _archive_set_option(struct archive *a, @@ -102,8 +102,8 @@ _archive_set_options(struct archive *a, const char *options, unsigned int magic, const char *fn, option_handler use_option) { int allok = 1, anyok = 0, ignore_mod_err = 0, r; - char *data; - char *s, *mod, *opt, *val; + char *data, *s; + const char *mod, *opt, *val; archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn); @@ -168,10 +168,10 @@ _archive_set_options(struct archive *a, const char *options, } static char * -parse_option(char **s, char **m, char **o, char **v) +parse_option(char **s, const char **m, const char **o, const char **v) { - char *end, *mod, *opt, *val; - char *p; + const char *mod, *val; + char *end, *opt, *p; end = NULL; mod = NULL;