lib/fuse_opt: fix cppcheck warnings

- Reduce scope of 'arglen' variable
- Mark 'param' as const pointer

Fixes cppcheck warnings:
- cppcheck-variableScope
- cppcheck-constVariablePointer

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
This commit is contained in:
Bernd Schubert
2026-04-05 13:12:40 +02:00
parent 2a83181ebe
commit 68fc66bfd0
+2 -2
View File
@@ -170,10 +170,10 @@ static int call_proc(struct fuse_opt_context *ctx, const char *arg, int key,
static int match_template(const char *t, const char *arg, unsigned *sepp)
{
int arglen = strlen(arg);
const char *sep = strchr(t, '=');
sep = sep ? sep : strchr(t, ' ');
if (sep && (!sep[1] || sep[1] == '%')) {
int arglen = strlen(arg);
int tlen = sep - t;
if (sep[0] == '=')
tlen ++;
@@ -253,7 +253,7 @@ static int process_opt_sep_arg(struct fuse_opt_context *ctx,
{
int res;
char *newarg;
char *param;
const char *param;
if (next_arg(ctx, arg) == -1)
return -1;