diff options
author | Colin Watson <cjwatson@debian.org> | 2003-09-23 18:08:35 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2003-09-23 18:08:35 +0000 |
commit | d59fd3e421aa81b8e5e118f3f806081df2aca879 (patch) | |
tree | 356a4e607edc979c625bb33db63c656d771478bd /openbsd-compat/strlcat.c | |
parent | 7505658c58e96b8d270f1928a0e1fa7f3e0c266b (diff) | |
parent | 45431c9b4677608680cd071768cbf156b316a7e8 (diff) |
Merge 3.7.1p2 to the trunk. I have absolutely no idea yet whether this will
work.
Diffstat (limited to 'openbsd-compat/strlcat.c')
-rw-r--r-- | openbsd-compat/strlcat.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/openbsd-compat/strlcat.c b/openbsd-compat/strlcat.c index 3a9b5d1a7..cae16657c 100644 --- a/openbsd-compat/strlcat.c +++ b/openbsd-compat/strlcat.c | |||
@@ -1,42 +1,30 @@ | |||
1 | /* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */ | 1 | /* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
5 | * All rights reserved. | ||
6 | * | 5 | * |
7 | * Redistribution and use in source and binary forms, with or without | 6 | * Permission to use, copy, modify, and distribute this software for any |
8 | * modification, are permitted provided that the following conditions | 7 | * purpose with or without fee is hereby granted, provided that the above |
9 | * are met: | 8 | * copyright notice and this permission notice appear in all copies. |
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer. | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in the | ||
14 | * documentation and/or other materials provided with the distribution. | ||
15 | * 3. The name of the author may not be used to endorse or promote products | ||
16 | * derived from this software without specific prior written permission. | ||
17 | * | 9 | * |
18 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY | 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
20 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
21 | * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
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 | */ | 17 | */ |
29 | 18 | ||
30 | #include "includes.h" | 19 | #include "includes.h" |
31 | #ifndef HAVE_STRLCAT | 20 | #ifndef HAVE_STRLCAT |
32 | 21 | ||
33 | #if defined(LIBC_SCCS) && !defined(lint) | 22 | #if defined(LIBC_SCCS) && !defined(lint) |
34 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $"; | 23 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $"; |
35 | #endif /* LIBC_SCCS and not lint */ | 24 | #endif /* LIBC_SCCS and not lint */ |
36 | 25 | ||
37 | #include <sys/types.h> | 26 | #include <sys/types.h> |
38 | #include <string.h> | 27 | #include <string.h> |
39 | #include "strlcat.h" | ||
40 | 28 | ||
41 | /* | 29 | /* |
42 | * Appends src to string dst of size siz (unlike strncat, siz is the | 30 | * Appends src to string dst of size siz (unlike strncat, siz is the |
@@ -46,10 +34,7 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp | |||
46 | * If retval >= siz, truncation occurred. | 34 | * If retval >= siz, truncation occurred. |
47 | */ | 35 | */ |
48 | size_t | 36 | size_t |
49 | strlcat(dst, src, siz) | 37 | strlcat(char *dst, const char *src, size_t siz) |
50 | char *dst; | ||
51 | const char *src; | ||
52 | size_t siz; | ||
53 | { | 38 | { |
54 | register char *d = dst; | 39 | register char *d = dst; |
55 | register const char *s = src; | 40 | register const char *s = src; |