From e8a1e7d224918ba23fe0cd125e70907cb31aea31 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 May 2015 18:54:58 +0200 Subject: Fix -Wall -Wpedantic warnings Signed-off-by: Jo-Philipp Wich --- iwinfo_utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'iwinfo_utils.c') diff --git a/iwinfo_utils.c b/iwinfo_utils.c index 9654207..f4b7b58 100644 --- a/iwinfo_utils.c +++ b/iwinfo_utils.c @@ -177,15 +177,16 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id) FILE *mtd; uint16_t *bc; - int fd, len, off; + int fd; + unsigned int len, off; char buf[128]; if (!(mtd = fopen("/proc/mtd", "r"))) return -1; - while (fgets(buf, sizeof(buf), mtd) > 0) + while (fgets(buf, sizeof(buf), mtd) != NULL) { - if (fscanf(mtd, "mtd%d: %x %*x %127s", &off, &len, buf) < 3 || + if (fscanf(mtd, "mtd%u: %x %*x %127s", &off, &len, buf) < 3 || (strcmp(buf, "\"boardconfig\"") && strcmp(buf, "\"EEPROM\"") && strcmp(buf, "\"factory\""))) { @@ -246,7 +247,7 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id) id->subsystem_vendor_id = 0x1814; /* device */ - if (bc[off] & 0xf0 == 0x30) + if ((bc[off] & 0xf0) == 0x30) id->device_id = (bc[off] >> 8) | (bc[off] & 0x00ff) << 8; else id->device_id = bc[off]; -- cgit v1.2.1