diff --git a/src/bin/system/machine/machine.bogox b/src/bin/system/machine/machine.bogox index b16fa83..4a2e9d2 100644 --- a/src/bin/system/machine/machine.bogox +++ b/src/bin/system/machine/machine.bogox @@ -64,6 +64,22 @@ strsli_printf(const char *fmt, ...) return buf; } +void +strimmer(char *s) +{ + char *cp = s; + + while (*cp) + { + if ((*cp == '\r') || (*cp == '\n')) + { + *cp = '\0'; + return; + } + cp++; + } +} + #if defined(__FreeBSD__) || defined(__DragonFly__) static long int _sysctlfromname(const char *name, void *mib, int depth, size_t *len) diff --git a/src/bin/system/machine/sensors.bogox b/src/bin/system/machine/sensors.bogox index e521ee7..3c35192 100644 --- a/src/bin/system/machine/sensors.bogox +++ b/src/bin/system/machine/sensors.bogox @@ -202,9 +202,14 @@ system_sensors_thermal_get(int *sensor_count) snprintf(buf, sizeof(buf), "%s/name", link); sensor->name = file_contents(buf); + if (sensor->name) + strimmer(sensor->name); snprintf(buf, sizeof(buf), "%s/temp%d_label", link, id); sensor->child_name = file_contents(buf); + if (sensor->child_name) + strimmer(sensor->name); + snprintf(buf, sizeof(buf), "%s/temp%d_input", link, id); sensor->path = strdup(buf); char *d = file_contents(buf);