mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-18 17:32:09 +08:00
change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3 Signed-off-by: lilei19 <lilei19@xiaomi.com>
This commit is contained in:
@@ -69,9 +69,13 @@ struct xmlrpc_entry_s get_device_stats =
|
||||
|
||||
static int calls_get_device_stats(struct xmlrpc_s *xmlcall)
|
||||
{
|
||||
char username[80], password[80];
|
||||
char lastCommand[80], curState[80];
|
||||
int request = 0, status, ret;
|
||||
char username[80];
|
||||
char password[80];
|
||||
char lastCommand[80];
|
||||
char curState[80];
|
||||
int request = 0;
|
||||
int status;
|
||||
int ret;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -100,8 +104,8 @@ static int calls_get_device_stats(struct xmlrpc_s *xmlcall)
|
||||
/* Dummy up some data... */
|
||||
|
||||
status = 1;
|
||||
strcpy(lastCommand, "reboot");
|
||||
strcpy(curState, "Normal Operation");
|
||||
strlcpy(lastCommand, "reboot", sizeof(lastCommand));
|
||||
strlcpy(curState, "Normal Operation", sizeof(curState));
|
||||
|
||||
ret = xmlrpc_buildresponse(xmlcall, "{iss}",
|
||||
"status", status,
|
||||
|
Reference in New Issue
Block a user