]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
util: Drop unused variable num_chars
authorMartin Schwenke <martin@meltin.net>
Tue, 15 Feb 2022 08:32:52 +0000 (19:32 +1100)
committerVolker Lendecke <vl@samba.org>
Thu, 17 Feb 2022 18:12:51 +0000 (18:12 +0000)
clang complains:

../../lib/util/genrand_util.c:99:9: error: variable 'num_chars' set but not used [-Werror,-Wunused-but-set-variable]
        size_t num_chars = 0;
               ^

That is, the variable is initialised and incremented but the value is
never used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/util/genrand_util.c

index 82085184e82249920f774c97a367bf419e26cd9f..1ef4e446e187b90de8684b0f24c39cbc13c68b80 100644 (file)
@@ -96,7 +96,6 @@ _PUBLIC_ uint64_t generate_unique_u64(uint64_t veto_value)
 _PUBLIC_ bool check_password_quality(const char *pwd)
 {
        size_t ofs = 0;
-       size_t num_chars = 0;
        size_t num_digits = 0;
        size_t num_upper = 0;
        size_t num_lower = 0;
@@ -120,7 +119,6 @@ _PUBLIC_ bool check_password_quality(const char *pwd)
                        break;
                }
                ofs += len;
-               num_chars += 1;
 
                if (len == 1) {
                        const char *na = "~!@#$%^&*_-+=`|\\(){}[]:;\"'<>,.?/";