1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-10-02 06:59:09 +00:00

Fix update_interval handling from CLI args

This commit is contained in:
Brenden Matthews 2024-02-21 09:25:54 -05:00
parent a1ab393318
commit 51f6f0576c

View File

@ -2169,9 +2169,9 @@ void initialisation(int argc, char **argv) {
break; break;
case 'u': case 'u':
state->pushinteger(dpi_scale(strtol(optarg, &conv_end, 10))); state->pushnumber(strtod(optarg, &conv_end));
if (*conv_end != 0) { if (*conv_end != 0) {
CRIT_ERR("'%s' is a wrong update-interval", optarg); CRIT_ERR("'%s' is an invalid update interval", optarg);
} }
update_interval.lua_set(*state); update_interval.lua_set(*state);
break; break;
@ -2179,7 +2179,7 @@ void initialisation(int argc, char **argv) {
case 'i': case 'i':
state->pushinteger(strtol(optarg, &conv_end, 10)); state->pushinteger(strtol(optarg, &conv_end, 10));
if (*conv_end != 0) { if (*conv_end != 0) {
CRIT_ERR("'%s' is a wrong number of update-times", optarg); CRIT_ERR("'%s' is an invalid number of update times", optarg);
} }
total_run_times.lua_set(*state); total_run_times.lua_set(*state);
break; break;
@ -2187,7 +2187,7 @@ void initialisation(int argc, char **argv) {
case 'x': case 'x':
state->pushinteger(strtol(optarg, &conv_end, 10)); state->pushinteger(strtol(optarg, &conv_end, 10));
if (*conv_end != 0) { if (*conv_end != 0) {
CRIT_ERR("'%s' is a wrong value for the X-position", optarg); CRIT_ERR("'%s' is an invalid value for the X-position", optarg);
} }
gap_x.lua_set(*state); gap_x.lua_set(*state);
break; break;