strncpy.c (e19d46c808267f53455e96a28ff7654211523d2c) strncpy.c (e55512504d0178983978d64d67eed1cc85826523)
1/*-
2 * Copyright (c) 2023 The FreeBSD Foundation
3 *
4 * This software was developed by Robert Clausecker <fuz@FreeBSD.org>
5 * under sponsorship from the FreeBSD Foundation.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE
27 */
28
29#include <sys/cdefs.h>
30#include <string.h>
31
1/*-
2 * Copyright (c) 2023 The FreeBSD Foundation
3 *
4 * This software was developed by Robert Clausecker <fuz@FreeBSD.org>
5 * under sponsorship from the FreeBSD Foundation.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE
27 */
28
29#include <sys/cdefs.h>
30#include <string.h>
31
32#undef strncpy /* _FORTIFY_SOURCE */
33
32char *__stpncpy(char *restrict, const char *restrict, size_t);
33
34char *
35strncpy(char *restrict dst, const char *restrict src, size_t len)
36{
37
38 __stpncpy(dst, src, len);
39
40 return (dst);
41}
34char *__stpncpy(char *restrict, const char *restrict, size_t);
35
36char *
37strncpy(char *restrict dst, const char *restrict src, size_t len)
38{
39
40 __stpncpy(dst, src, len);
41
42 return (dst);
43}