Commit a1879bf5 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Avoid conflict with C99 float conversion.

parent 9fa780a9
...@@ -704,19 +704,19 @@ static int callback_http(struct lws *wsi, ...@@ -704,19 +704,19 @@ static int callback_http(struct lws *wsi,
if (!strncmp(rcv, "status ", 7)) { if (!strncmp(rcv, "status ", 7)) {
char *ident; char *ident;
sscanf(rcv, "%*s %as", &ident); sscanf(rcv, "%*s %ms", &ident);
start_status(wsi, ident); start_status(wsi, ident);
} else if (!strncmp(rcv, "trace ", 6)) { } else if (!strncmp(rcv, "trace ", 6)) {
int freq; int freq;
char *variable; char *variable;
sscanf(rcv, "%*s %d %as", &freq, &variable); sscanf(rcv, "%*s %d %ms", &freq, &variable);
start_trace(wsi, freq, variable); start_trace(wsi, freq, variable);
} else if (!strncmp(rcv, "command ", 8)) { } else if (!strncmp(rcv, "command ", 8)) {
char *ident; char *ident;
char *command; char *command;
sscanf(rcv, "%*s %as", &ident); sscanf(rcv, "%*s %ms", &ident);
command = rcv + 8 + strlen(ident) + 1; command = rcv + 8 + strlen(ident) + 1;
do_command(ident, command); do_command(ident, command);
...@@ -728,7 +728,7 @@ static int callback_http(struct lws *wsi, ...@@ -728,7 +728,7 @@ static int callback_http(struct lws *wsi,
struct command *command; struct command *command;
enum command_value_type vtype; enum command_value_type vtype;
sscanf(rcv, "%*s %as %as", &name, &type); sscanf(rcv, "%*s %ms %ms", &name, &type);
if (!strcmp(type, "bool")) { if (!strcmp(type, "bool")) {
int v; int v;
sscanf(rcv, "%*s %*s %*s %d", &v); sscanf(rcv, "%*s %*s %*s %d", &v);
...@@ -748,7 +748,7 @@ static int callback_http(struct lws *wsi, ...@@ -748,7 +748,7 @@ static int callback_http(struct lws *wsi,
if (!strcmp(type, "float")) { if (!strcmp(type, "float")) {
float v; float v;
char *vstr; char *vstr;
sscanf(rcv, "%*s %*s %*s %as", &vstr); sscanf(rcv, "%*s %*s %*s %ms", &vstr);
if (!strcmp(vstr, "TRACK")) { if (!strcmp(vstr, "TRACK")) {
entry.value.f = 0.0; entry.value.f = 0.0;
entry.type = COMMAND_PTYPE_SETPOINT_TRACK; entry.type = COMMAND_PTYPE_SETPOINT_TRACK;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment