]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: fix unsigned int usage for ctype.h functions
authorKarel Zak <kzak@redhat.com>
Wed, 26 Oct 2016 08:13:03 +0000 (10:13 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 26 Oct 2016 08:13:47 +0000 (10:13 +0200)
Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/partx.c
libfdisk/src/gpt.c
login-utils/lslogins.c
misc-utils/logger.c
sys-utils/dmesg.c

index 46224a3f0aa7e67369f67d1dbda8baae53a2cd0c..cff160fbe57998771c3a85d37a1c0f04ea52ef8a 100644 (file)
@@ -193,10 +193,10 @@ static int get_partno_from_device(char *partition, dev_t devno)
        sz = strlen(partition);
        p = partition + sz - 1;
 
-       if (!isdigit((unsigned int) *p))
+       if (!isdigit((unsigned char) *p))
                goto err;
 
-       while (isdigit((unsigned int) *(p - 1))) p--;
+       while (isdigit((unsigned char) *(p - 1))) p--;
 
        errno = 0;
        partno = strtol(p, &end, 10);
index aa83a4f67e1211aeef85506199293009788d0874..7fcb3c242449e73fb2dfd28a2571024b0668bc2f 100644 (file)
@@ -1601,9 +1601,9 @@ static int gpt_entry_attrs_from_string(
                        p += sizeof(GPT_ATTRSTR_NOBLOCK) - 1;
 
                /* GUID:<bit> as well as <bit> */
-               } else if (isdigit((unsigned int) *p)
+               } else if (isdigit((unsigned char) *p)
                           || (strncmp(p, "GUID:", 5) == 0
-                              && isdigit((unsigned int) *(p + 5)))) {
+                              && isdigit((unsigned char) *(p + 5)))) {
                        char *end = NULL;
 
                        if (*p == 'G')
index 76ada7fd2e789284ffe4533e4161b869e46e546e..78d4ed46f4396c77dcd6019c34036dd856d9c141 100644 (file)
@@ -571,7 +571,7 @@ static int valid_pwd(const char *str)
        const char *p;
 
        for (p = str; p && *p; p++)
-               if (!isalnum((unsigned int) *p))
+               if (!isalnum((unsigned char) *p))
                        return 0;
        return p > str ? 1 : 0;
 }
index 63c43993ca6426573ea964beb818ca5d80ee8735..0e1ebfffcb11b77d4785e6df7a62ba6ca0ad28d7 100644 (file)
@@ -685,7 +685,7 @@ static int valid_structured_data_id(const char *str)
        for (p = str; p < at; p++) {
                if (*p == '[' || *p == '=' || *p == '"' || *p == '@')
                        return 0;
-               if (isblank((unsigned int) *p) || iscntrl((unsigned int) *p))
+               if (isblank((unsigned char) *p) || iscntrl((unsigned char) *p))
                        return 0;
        }
        return 1;
index 0056b2520a8d30c4fc5d6fe0d34e9c06386daa2c..a06c6820da90d036321d68c859b989d7157bccb0 100644 (file)
@@ -641,8 +641,8 @@ static void safe_fwrite(const char *buf, size_t size, int indent, FILE *out)
                i += len - 1;
 #else
                len = 1;
-               if (!isprint((unsigned int) *p) &&
-                       !isspace((unsigned int) *p))        /* non-printable */
+               if (!isprint((unsigned char) *p) &&
+                   !isspace((unsigned char) *p))        /* non-printable */
                        hex = 1;
 #endif
                if (hex)