mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 04:32:55 +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:
parent
8feae589dc
commit
e834782ddb
@ -1169,7 +1169,7 @@ static int open_sysfs_sensor(const char *dir, const char *dev, const char *type,
|
|||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
/* if it fails, strip the /device from dev and attempt again */
|
/* 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;
|
buf[len_to_trunc] = 0;
|
||||||
snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n);
|
snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n);
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
|
Loading…
Reference in New Issue
Block a user