New upstream version 4.19.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "string/strcpy/stpecpy.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STPECPY_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "string/strcpy/strncat.h"
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCAT_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "sizeof.h"
|
||||
|
||||
|
||||
#define STRNCAT(dst, src) strncat(dst, src, countof(src))
|
||||
// strncat_a - nonstring catenate-into-string array
|
||||
#define strncat_a(dst, src) strncat(dst, src, countof(src))
|
||||
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "string/strcpy/strncpy.h"
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCPY_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "sizeof.h"
|
||||
|
||||
|
||||
#define STRNCPY(dst, src) strncpy(dst, src, countof(dst))
|
||||
// strncpy_a - nonstring copy array
|
||||
#define strncpy_a(dst, src) strncpy(dst, src, countof(dst))
|
||||
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRTCPY_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -17,34 +17,8 @@
|
||||
#include "sizeof.h"
|
||||
|
||||
|
||||
/*
|
||||
* SYNOPSIS
|
||||
* [[gnu::null_terminated_string_arg(2)]]
|
||||
* int STRTCPY(char dst[restrict], const char *restrict src);
|
||||
*
|
||||
* ARGUMENTS
|
||||
* dst Destination buffer where to copy a string.
|
||||
* src Source string to be copied into dst.
|
||||
*
|
||||
* DESCRIPTION
|
||||
* This macro copies the string pointed to by src, into a string
|
||||
* at the buffer pointed to by dst. If the destination buffer,
|
||||
* isn't large enough to hold the copy, the resulting string is
|
||||
* truncated. The size of the buffer is calculated internally via
|
||||
* countof().
|
||||
*
|
||||
* RETURN VALUE
|
||||
* -1 If this call truncated the resulting string.
|
||||
*
|
||||
* strlen(dst)
|
||||
* On success.
|
||||
*
|
||||
* ERRORS
|
||||
* This function doesn't set errno.
|
||||
*/
|
||||
|
||||
|
||||
#define STRTCPY(dst, src) strtcpy(dst, src, countof(dst))
|
||||
// strtcpy_a - string truncate copy array
|
||||
#define strtcpy_a(dst, src) strtcpy(dst, src, countof(dst))
|
||||
|
||||
|
||||
ATTR_STRING(2)
|
||||
@@ -52,6 +26,7 @@ inline ssize_t strtcpy(char *restrict dst, const char *restrict src,
|
||||
size_t dsize);
|
||||
|
||||
|
||||
// strtcpy - string truncate copy
|
||||
inline ssize_t
|
||||
strtcpy(char *restrict dst, const char *restrict src, size_t dsize)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user