+ line_s = *saveptr;
+
+ /* read the device */
+ *dev = ++p;
+ if (!(p = strchr(p, line_s[0])))
+ goto out_fail;
+ *(p++) = '\0';
+ /* jump over the devname */
+ if (!(p = strchr(p, line_s[0])))
+ goto out_fail;
+ /* read the value */
+ cval = ++p;
+ if (!(p = strchr(p, line_s[0])))
+ goto out_fail;
+ *(p++) = '\0';
+ *unit = *(p++);
+ *val = strtol(cval, &endptr, 10);
+ if (*endptr)
+ goto out_fail;
+
+ /* preset p for next call */
+ p++;
+
+ return 0;
+out_fail:
+ free(*saveptr);
+ return 1;
+}
+
+void update_hddtemp(void) {
+ char *data, *dev, unit, *saveptr;
+ short val;
+ static double last_hddtemp_update = 0.0;
+
+ /* limit tcp connection overhead */
+ if (current_update_time - last_hddtemp_update < 5)
+ return;
+ last_hddtemp_update = current_update_time;
+
+ free_hddtemp_info();
+
+ if (!(data = fetch_hddtemp_output()))
+ return;