logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: e18d8a6710957a563634ed4c02fae66a97b7a94e
parent 0e4a48fcb51bef3eba18845227351e965a524998
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 12 Jul 2023 20:07:13 +0200

cmd/env: clang-16 fixes

Diffstat:

Mcmd/env.c7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cmd/env.c b/cmd/env.c @@ -1,5 +1,5 @@ // Collection of Unix tools, comparable to coreutils -// SPDX-FileCopyrightText: 2017-2022 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> +// SPDX-FileCopyrightText: 2017-2023 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only #define _POSIX_C_SOURCE 200809L @@ -41,6 +41,7 @@ main(int argc, char *argv[]) { int c; bool flag_i = false; + char *val; /* flawfinder: ignore. Old implementations of getopt should fix themselves */ while((c = getopt(argc, argv, ":iu:-:")) != -1) @@ -54,10 +55,10 @@ main(int argc, char *argv[]) unsetenv(optarg); break; case '-': - char *val = strchr(optarg, '='); + val = strchr(optarg, '='); if(val == NULL) { - fprintf(stderr, "env: Error: Missing = in long option\n", optopt); + fprintf(stderr, "env: Error: Missing = in long option\n"); return 1; }