709e6b4497
strncat(3), strlcpy(3), and many other functions are often misused for catenating strings, when they should never be used for that. strlcat(3) is good. However, there's no equivalent to strlcat(3) similar to snprintf(3). Let's add stpecpy(), which is similar to strlcat(3), but it is also the only function compatible with stpeprintf(), which makes it more useful than strlcat(3). Signed-off-by: Alejandro Colomar <alx@kernel.org>
21 lines
321 B
C
21 lines
321 B
C
/*
|
|
* SPDX-FileCopyrightText: 2022 - 2023, Alejandro Colomar <alx@kernel.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#if !defined(HAVE_STPECPY)
|
|
|
|
#ident "$Id$"
|
|
|
|
#include "stpecpy.h"
|
|
|
|
|
|
extern inline char *stpecpy(char *dst, char *end, const char *restrict src);
|
|
|
|
|
|
#endif // !HAVE_STPECPY
|