Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Feb 15, 2023
2 parents 3f69658 + b7f7beb commit 55aa8df
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/httpserver/http_fns.c
Expand Up @@ -1500,18 +1500,17 @@ int http_fn_startup_command(http_request_t* request) {
"You can use them to init peripherals and drivers, like BL0942 energy sensor. "
"Use backlog cmd1; cmd2; cmd3; etc to enter multiple commands</p>");

if (http_getArg(request->url, "data", tmpA, sizeof(tmpA))) {
if (http_getArg(request->url, "startup_cmd", tmpA, sizeof(tmpA))) {
http_getArg(request->url, "data", tmpA, sizeof(tmpA));
// hprintf255(request,"<h3>Set command to %s!</h3>",tmpA);
// tmpA can be longer than 128 bytes and this would crash
// tmpA can be longer than 128 bytes and this would crash
hprintf255(request, "<h3>Command changed!</h3>");
CFG_SetShortStartupCommand(tmpA);

CFG_Save_IfThereArePendingChanges();
}
else {
}

add_label_text_field(request, "Startup command", "data", CFG_GetShortStartupCommand(), "<form action=\"/startup_command\">");
poststr(request, "<input type='hidden' name='startup_cmd' value='1'>");
poststr(request, SUBMIT_AND_END_FORM);

poststr(request, htmlFooterReturnToCfgLink);
Expand Down

0 comments on commit 55aa8df

Please sign in to comment.