Fix strlcpy/strlcat error on macOS
This commit is contained in:
parent
a90969b6c3
commit
047fdbba3b
@ -5,6 +5,7 @@
|
|||||||
* (there is no need to include the same files twice).
|
* (there is no need to include the same files twice).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h> /* for strlen() */
|
||||||
#include "lstring.h"
|
#include "lstring.h"
|
||||||
|
|
||||||
#if !defined HAVE_STRLCPY
|
#if !defined HAVE_STRLCPY
|
||||||
@ -27,11 +28,6 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
#include <sys/types.h> already included through lstring.h
|
|
||||||
*/
|
|
||||||
#include <string.h> /* for strlen() */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy src to string dst of size siz. At most siz-1 characters
|
* Copy src to string dst of size siz. At most siz-1 characters
|
||||||
* will be copied. Always NUL terminates (unless siz == 0).
|
* will be copied. Always NUL terminates (unless siz == 0).
|
||||||
@ -85,11 +81,6 @@ strlcpy(char *dst, const char *src, size_t siz)
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
#include <sys/types.h> already included
|
|
||||||
#include <string.h> already included
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Appends src to string dst of size siz (unlike strncat, siz is the
|
* Appends src to string dst of size siz (unlike strncat, siz is the
|
||||||
* full size of dst, not space left). At most siz-1 characters
|
* full size of dst, not space left). At most siz-1 characters
|
||||||
|
@ -2,12 +2,18 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#if (defined __WATCOMC__ && __WATCOMC__ >= 1240)
|
#if defined __WATCOMC__ && __WATCOMC__ >= 1240
|
||||||
/* OpenWatcom introduced BSD "safe string functions" with version 1.4 */
|
/* OpenWatcom introduced BSD "safe string functions" with version 1.4 */
|
||||||
|| defined __APPLE__
|
|
||||||
#define HAVE_SAFESTR
|
#define HAVE_SAFESTR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined strlcpy
|
||||||
|
#define HAVE_STRLCPY
|
||||||
|
#endif
|
||||||
|
#if defined strlcat
|
||||||
|
#define HAVE_STRLCAT
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_SAFESTR
|
#if defined HAVE_SAFESTR
|
||||||
#define HAVE_STRLCPY
|
#define HAVE_STRLCPY
|
||||||
#define HAVE_STRLCAT
|
#define HAVE_STRLCAT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user