From 8ff87d2600c362dc2c0f10c8c067fffc3306cd7d Mon Sep 17 00:00:00 2001 From: Drath Date: Mon, 11 May 2026 12:14:13 +0000 Subject: [PATCH] uwu --- src/utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils.c b/src/utils.c index 9e4ace4..55ced08 100644 --- a/src/utils.c +++ b/src/utils.c @@ -56,18 +56,17 @@ int get_hwmon_dir(char *path, const size_t bufsz) { return -1; } - /* instead of building the path here we could build it once in *_detect funcs for each sensor, but thats a lot of paths damn * actual slowdown is in the syscalls anyway, open(), read(), close () */ /* read n bytes from path into buffer */ inline size_t read_file(const char *dir, const char *file, char *buffer, const size_t n) { - char path[192]; // bug alert + char path[160]; // bug alert char *nt = stpcpy(path, dir); // nt is a pointer to the null terminator of the copied string stpcpy(nt, file); // write at the null terminator address, aka append to the end const int fd = open(path, O_RDONLY | O_CLOEXEC); if (fd < 0) { - if (buffer != NULL) + if (buffer != NULL) // if its null means we're just checking if it exists at all, so dont log it applog(LOG_ERR, "Error reading %s", path); return 0; }