Skip to content

Commit

Permalink
dstate: fix dstate_delrange() socket protocol command
Browse files Browse the repository at this point in the history
The documented (and used in server-side) command for deleting a range is `DELRANGE <varname> <minvalue> <maxvalue>`, not `DELRANGE <varname> "<minvalue> <maxvalue>"`, as used in dstate_delrange().
So, fix that unused (well, at least in NUT) function to use the correct format.

Also, remove an extraneous additional space in the command used in dstate_addrange().
  • Loading branch information
zykh committed Feb 3, 2019
1 parent 0553c6d commit 85cc32c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ int dstate_addrange(const char *var, const int min, const int max)
ret = state_addrange(dtree_root, var, min, max);

if (ret == 1) {
send_to_all("ADDRANGE %s %i %i\n", var, min, max);
send_to_all("ADDRANGE %s %i %i\n", var, min, max);
/* Also add the "NUMBER" flag for ranges */
dstate_addflags(var, ST_FLAG_NUMBER);
}
Expand Down Expand Up @@ -817,7 +817,7 @@ int dstate_delrange(const char *var, const int min, const int max)

/* update listeners */
if (ret == 1) {
send_to_all("DELRANGE %s \"%i %i\"\n", var, min, max);
send_to_all("DELRANGE %s %i %i\n", var, min, max);
}

return ret;
Expand Down

0 comments on commit 85cc32c

Please sign in to comment.