From b76053efeaea120d051b6e2fe4e8f9003f15d501 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 13 Jun 2012 16:50:14 +0000 Subject: [PATCH] Bugfix: modminer: Fix unsigned/signed comparison and similar warnings --- driver-modminer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver-modminer.c b/driver-modminer.c index 3077653a..d139091e 100644 --- a/driver-modminer.c +++ b/driver-modminer.c @@ -164,7 +164,7 @@ fd_set fds; p = strrchr(buf, '=') ?: p; if (p[0] == '=') ++p; - long fwusercode = strtol(p, &p, 16); + unsigned long fwusercode = (unsigned long)strtoll(p, &p, 16); if (p[0] != '\0') bailout(LOG_ERR, "Bad usercode in ModMiner firmware file"); if (fwusercode == 0xffffffff) @@ -197,7 +197,7 @@ fd_set fds; if (6 != write(fd, buf, 6)) bailout2(LOG_ERR, "%s %u: Error programming %s (cmd)", modminer->api->name, modminer->device_id, modminer->device_path); status_read("cmd reply"); - size_t buflen; + ssize_t buflen; while (len) { buflen = len < 32 ? len : 32; if (fread(buf, buflen, 1, f) != 1)