strlcpy.c (5864b79cd2852339f3025ee81769233071d60934) | strlcpy.c (de5fe5d53b634e506f94a6df3a9261aa20fa152f) |
---|---|
1/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ 2 3/* 4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) | 1/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ 2 3/* 4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) |
31#if 0 32static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; 33#endif | 31static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"); |
34#endif /* LIBC_SCCS and not lint */ | 32#endif /* LIBC_SCCS and not lint */ |
35#ifndef lint 36static const char rcsid[] = 37 "$FreeBSD$"; 38#endif | 33#include <sys/cdefs.h> 34__FBSDID("$FreeBSD$"); |
39 40#include <sys/types.h> 41#include <string.h> 42 43/* 44 * Copy src to string dst of size siz. At most siz-1 characters 45 * will be copied. Always NUL terminates (unless siz == 0). 46 * Returns strlen(src); if retval >= siz, truncation occurred. --- 28 unchanged lines hidden --- | 35 36#include <sys/types.h> 37#include <string.h> 38 39/* 40 * Copy src to string dst of size siz. At most siz-1 characters 41 * will be copied. Always NUL terminates (unless siz == 0). 42 * Returns strlen(src); if retval >= siz, truncation occurred. --- 28 unchanged lines hidden --- |