mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 03:37:46 +00:00
[trel] avoid compiler warning on use of strncpy (#6630)
This commit is contained in:
@@ -629,11 +629,11 @@ void platformTrelInit(const char *aTrelUrl)
|
||||
{
|
||||
ot::Posix::RadioUrl url(aTrelUrl);
|
||||
|
||||
strncpy(sInterfaceName, url.GetPath(), sizeof(sInterfaceName));
|
||||
strncpy(sInterfaceName, url.GetPath(), sizeof(sInterfaceName) - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(sInterfaceName, OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME, sizeof(sInterfaceName));
|
||||
strncpy(sInterfaceName, OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME, sizeof(sInterfaceName) - 1);
|
||||
}
|
||||
|
||||
sInterfaceName[sizeof(sInterfaceName) - 1] = 0;
|
||||
|
||||
Reference in New Issue
Block a user