ig this is least stupid

This commit is contained in:
2026-06-24 20:32:40 +02:00
parent 1099bb6688
commit 0352675e79

View File

@@ -70,8 +70,7 @@ inline char *pretty_bytes(const uint64_t bytes, int8_t start_suffix, char *buf,
int get_hwmon_dir(char *path, const size_t bufsz) {
glob_t g;
if (strlcat(path, "/hwmon*", bufsz) >= bufsz)
return -1;
strcpy(path + strlen(path), "/hwmon*");
if (glob(path, 0, NULL, &g) == 0) {
strlcpy(path, g.gl_pathv[0], bufsz); // same size as hwmon length, careful