mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-09 06:25:16 +00:00
examples/xmlrpc: Fix calls buffers size.
* examples/xmlrpc/calls.c used 80 bytes call buffers. * update buffers to CONFIG_XMLRPC_STRINGSIZE+1 that is build time configurable. * this keeps buffers size coherent with configuration. * updated internal variable names to pass lint checks. Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
This commit is contained in:
parent
1e4a952eea
commit
bbcba55bbc
1 changed files with 8 additions and 8 deletions
|
|
@ -70,10 +70,10 @@ struct xmlrpc_entry_s get_device_stats =
|
|||
|
||||
static int calls_get_device_stats(struct xmlrpc_s *xmlcall)
|
||||
{
|
||||
char username[80];
|
||||
char password[80];
|
||||
char lastCommand[80];
|
||||
char curState[80];
|
||||
char username[CONFIG_XMLRPC_STRINGSIZE + 1];
|
||||
char password[CONFIG_XMLRPC_STRINGSIZE + 1];
|
||||
char lastcmd[CONFIG_XMLRPC_STRINGSIZE + 1];
|
||||
char curstate[CONFIG_XMLRPC_STRINGSIZE + 1];
|
||||
int request = 0;
|
||||
int status;
|
||||
int ret;
|
||||
|
|
@ -105,13 +105,13 @@ static int calls_get_device_stats(struct xmlrpc_s *xmlcall)
|
|||
/* Dummy up some data... */
|
||||
|
||||
status = 1;
|
||||
strlcpy(lastCommand, "reboot", sizeof(lastCommand));
|
||||
strlcpy(curState, "Normal Operation", sizeof(curState));
|
||||
strlcpy(lastcmd, "reboot", sizeof(lastcmd));
|
||||
strlcpy(curstate, "Normal Operation", sizeof(curstate));
|
||||
|
||||
ret = xmlrpc_buildresponse(xmlcall, "{iss}",
|
||||
"status", status,
|
||||
"lastCommand", lastCommand,
|
||||
"currentState", curState);
|
||||
"lastCommand", lastcmd,
|
||||
"currentState", curstate);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue