mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
Fix (possibly overkill) hwmon parsing bug.
This commit is contained in:
parent
7f0929d03c
commit
1779ef3efd
22
src/conky.c
22
src/conky.c
@ -1835,18 +1835,18 @@ static struct text_object *construct_text_object(const char *s,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf1[0] = 0;
|
#define HWMON_RESET() {\
|
||||||
factor = 1.0;
|
buf1[0] = 0; \
|
||||||
offset = 0.0;
|
factor = 1.0; \
|
||||||
|
offset = 0.0; }
|
||||||
|
|
||||||
if (sscanf(arg, "%63s %63s %d %f %f", buf1, buf2, &n, &factor, &offset) == 5)
|
if (sscanf(arg, "%63s %63s %d %f %f", buf1, buf2, &n, &factor, &offset) == 5) found = 1; else HWMON_RESET();
|
||||||
found = 1;
|
if (!found && (sscanf(arg, "%63s %d %f %f", buf2, &n, &factor, &offset) == 3)) found = 1; else HWMON_RESET();
|
||||||
if (!found && (sscanf(arg, "%63s %d %f %f", buf2, &n, &factor, &offset) == 3))
|
if (!found && (sscanf(arg, "%63s %63s %d", buf1, buf2, &n) == 3)) found = 1; else HWMON_RESET();
|
||||||
found = 1;
|
if (!found && (sscanf(arg, "%63s %d", buf2, &n) == 2)) found = 1; else HWMON_RESET();
|
||||||
if (!found && (sscanf(arg, "%63s %63s %d", buf1, buf2, &n) == 3))
|
|
||||||
found = 1;
|
|
||||||
if (!found && (sscanf(arg, "%63s %d", buf2, &n) == 2))
|
#undef HWMON_RESET
|
||||||
found = 1;
|
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
ERR("hwmon failed to parse arguments");
|
ERR("hwmon failed to parse arguments");
|
||||||
|
Loading…
Reference in New Issue
Block a user