aboutsummaryrefslogtreecommitdiff
path: root/hardinfo/dmi_util.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2018-10-27 14:08:22 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2018-11-04 15:02:12 -0800
commit81026a56d57b3e8ee00f2f43003a90cde30664f3 (patch)
tree1a68faced6d16b1071db0ee7bc6013a58afead84 /hardinfo/dmi_util.c
parent9f6bc50073a1771f6fa6afd9b8b21889264291d0 (diff)
dmi_util: fix warnings
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo/dmi_util.c')
-rw-r--r--hardinfo/dmi_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hardinfo/dmi_util.c b/hardinfo/dmi_util.c
index 5da5a99b..86600f27 100644
--- a/hardinfo/dmi_util.c
+++ b/hardinfo/dmi_util.c
@@ -211,7 +211,7 @@ char *dmi_chassis_type_str(int chassis_type, gboolean with_val) {
chassis_type = -1;
}
- if (chassis_type >= 0 && chassis_type < G_N_ELEMENTS(types)) {
+ if (chassis_type >= 0 && chassis_type < (int)G_N_ELEMENTS(types)) {
if (with_val)
return g_strdup_printf("[%d] %s", chassis_type, _(types[chassis_type]));
@@ -299,7 +299,7 @@ char *dmidecode_match(const char *name, const unsigned long *dmi_type, const uns
p = full;
while(next_nl = strchr(p, '\n')) {
strend(p, '\n');
- if (!sscanf(p, "Handle 0x%X", &ch) > 0 ) {
+ if (!(sscanf(p, "Handle 0x%X", &ch) > 0) ) {
if (!handle || *handle == ch) {
while(*p == '\t') p++;
if (strncmp(p, name, ln) == 0) {
@@ -335,7 +335,7 @@ dmi_handle_list *dmidecode_match_value(const char *name, const char *value, cons
p = full;
while(next_nl = strchr(p, '\n')) {
strend(p, '\n');
- if (!sscanf(p, "Handle 0x%X", &ch) > 0 ) {
+ if (!(sscanf(p, "Handle 0x%X", &ch) > 0) ) {
while(*p == '\t') p++;
if (strncmp(p, name, ln) == 0) {
if (*(p + ln) == ':') {