1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

Build fix for x86 arch.

size_t is unsigned long on x86-64, but not x86.

This fixes #759.
This commit is contained in:
Brenden Matthews 2019-01-09 08:05:47 -05:00
parent 8feae589dc
commit e834782ddb

View File

@ -1169,7 +1169,7 @@ static int open_sysfs_sensor(const char *dir, const char *dev, const char *type,
fd = open(path, O_RDONLY);
if (fd < 0) {
/* if it fails, strip the /device from dev and attempt again */
size_t len_to_trunc = std::max(7UL, strnlen(buf, 255)) - 7;
size_t len_to_trunc = std::max((size_t)7, strnlen(buf, 255)) - 7;
buf[len_to_trunc] = 0;
snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n);
fd = open(path, O_RDONLY);