aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2016-10-26 10:13:03 +0200
committerKarel Zak <kzak@redhat.com>2016-10-26 10:13:47 +0200
commitbae57b5a3c9fac14de4f0bb685958cb68937dc4d (patch)
tree1d2af90abf698201986ae2d893c6214de78aea93
parent82e8ddacb4ac9221835d5d1c2930cb5a5a0a8440 (diff)
downloadutil-linux-bae57b5a3c9fac14de4f0bb685958cb68937dc4d.tar.gz
misc: fix unsigned int usage for ctype.h functions
Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--disk-utils/partx.c4
-rw-r--r--libfdisk/src/gpt.c4
-rw-r--r--login-utils/lslogins.c2
-rw-r--r--misc-utils/logger.c2
-rw-r--r--sys-utils/dmesg.c4
5 files changed, 8 insertions, 8 deletions
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index 46224a3f0a..cff160fbe5 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -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);
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index aa83a4f67e..7fcb3c2424 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -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')
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 76ada7fd2e..78d4ed46f4 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -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;
}
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 63c43993ca..0e1ebfffcb 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -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;
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 0056b2520a..a06c6820da 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -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)