mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 01:19:51 +00:00
Add implementations for strlcpy/strlcat when missing (#737)
This commit shows how to add implementations of missing functions for platforms where those functions are not present. In this case we are adding the `strlcpy()` and `strlcat()`, which are "safe" replacements for `strncpy()` and `strncat()` that behave in a way more consistent with developer expectations. After this commit, adding additional replacements for missing functions should be fairly straightforward. [1]: http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one [2]: https://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
This commit is contained in:
committed by
Jonathan Hui
parent
127eb435d8
commit
73564c399a
@@ -101,6 +101,11 @@
|
||||
// Temporary !!! TODO - Remove this once we figure out the strncpy issue
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#ifdef OTBUILD
|
||||
#include <strlcat/strlcat.h>
|
||||
#include <strlcpy/strlcpy.h>
|
||||
#endif
|
||||
|
||||
// Disable a few warnings that we don't care about
|
||||
#pragma warning(disable:4200) // nonstandard extension used: zero-sized array in struct/union
|
||||
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
|
||||
|
||||
Reference in New Issue
Block a user