]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc/wsp: use unsigned char for high byte comparison
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 28 Nov 2024 03:06:10 +0000 (16:06 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 12 Mar 2025 03:38:34 +0000 (03:38 +0000)
../../librpc/wsp/wsp_util.c:244:28: warning: result of comparison of constant 160 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
  244 |                 if (strlen(t) == 1 && *t == 0xa0) {

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
librpc/wsp/wsp_util.c

index d07338b1b5abb218be164874c622d1c599f0ee1c..a072fbc4d268868bb611f4ea4d29922dcb7a4c5a 100644 (file)
@@ -241,7 +241,7 @@ static bool parse_properties_line(TALLOC_CTX *ctx,
        for (pos = 0; pos < talloc_array_length(csv_line); pos++) {
                t = strv_next(strv, t);
                /* the scraped property file can have a non ascii char */
-               if (strlen(t) == 1 && *t == 0xa0) {
+               if (strlen(t) == 1 && *(unsigned char *)t == 0xa0) {
                        csv_line[pos] = talloc_strdup(csv_line,
                                        "");
                } else {