Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 106 lines (93 sloc) 3.88 kb
8e3f23e3 » foobar
2003-02-19 ws fixes + missing $Id$ tags, headers added
1 /*
2 +----------------------------------------------------------------------+
dbeb4158 » andigutmans
2004-01-08 - A belated happy holidays and PHP 5
3 | PHP Version 5 |
8e3f23e3 » foobar
2003-02-19 ws fixes + missing $Id$ tags, headers added
4 +----------------------------------------------------------------------+
a666285b » laruence
2013-01-01 Happy New Year
5 | Copyright (c) 1997-2013 The PHP Group |
8e3f23e3 » foobar
2003-02-19 ws fixes + missing $Id$ tags, headers added
6 +----------------------------------------------------------------------+
5bd93221 » foobar
2006-01-01 bump year and license version
7 | This source file is subject to version 3.01 of the PHP license, |
8e3f23e3 » foobar
2003-02-19 ws fixes + missing $Id$ tags, headers added
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff2 » James Cox
2003-06-10 updating license information in the headers.
9 | available through the world-wide-web at the following url: |
5bd93221 » foobar
2006-01-01 bump year and license version
10 | http://www.php.net/license/3_01.txt |
8e3f23e3 » foobar
2003-02-19 ws fixes + missing $Id$ tags, headers added
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Author: |
16 +----------------------------------------------------------------------+
17 */
18
19 /* $Id$ */
20
85210ed9 » zsuraski
1999-11-27 Get Win32 to compile again
21 #include "php.h"
5d34e43f » Sascha Schumann
1999-11-26 Include php_config.h in both files, otherwise HAVE_STRLCAT/HAVE_STRLCPY
22
33a946d3 » Stig Bakken
1999-09-24 #if !HAVE_FOO -> #ifndef HAVE_FOO
23 #ifndef HAVE_STRLCAT
61a3c147 » andigutmans
1999-09-14 Add strlcpy/strlcat to the build process
24
25 /* $OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $ */
26
27 /*
28 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
29 * All rights reserved.
30 *
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
33 * are met:
34 * 1. Redistributions of source code must retain the above copyright
35 * notice, this list of conditions and the following disclaimer.
36 * 2. Redistributions in binary form must reproduce the above copyright
37 * notice, this list of conditions and the following disclaimer in the
38 * documentation and/or other materials provided with the distribution.
39 * 3. The name of the author may not be used to endorse or promote products
40 * derived from this software without specific prior written permission.
41 *
42 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
43 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
44 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
45 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
46 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
47 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
48 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
49 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
50 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
51 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 */
53
54 #if defined(LIBC_SCCS) && !defined(lint)
55 static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $";
56 #endif /* LIBC_SCCS and not lint */
57
58 #include <sys/types.h>
59 #include <string.h>
60
61 /*
62 * Appends src to string dst of size siz (unlike strncat, siz is the
63 * full size of dst, not space left). At most siz-1 characters
64 * will be copied. Always NUL terminates (unless siz == 0).
65 * Returns strlen(src); if retval >= siz, truncation occurred.
66 */
39e28225 » Sterling Hughes
2001-05-30 place nice with other libraries.
67 PHPAPI size_t php_strlcat(dst, src, siz)
61a3c147 » andigutmans
1999-09-14 Add strlcpy/strlcat to the build process
68 char *dst;
69 const char *src;
70 size_t siz;
71 {
72 register char *d = dst;
73 register const char *s = src;
74 register size_t n = siz;
75 size_t dlen;
76
77 /* Find the end of dst and adjust bytes left but don't go past end */
78 while (*d != '\0' && n-- != 0)
79 d++;
80 dlen = d - dst;
81 n = siz - dlen;
82
83 if (n == 0)
84 return(dlen + strlen(s));
85 while (*s != '\0') {
86 if (n != 1) {
87 *d++ = *s;
88 n--;
89 }
90 s++;
91 }
92 *d = '\0';
93
94 return(dlen + (s - src)); /* count does not include NUL */
95 }
96
97 #endif /* !HAVE_STRLCAT */
25c3a3a3 » rlerdorf
2001-06-05 vim-6 does folding - clean up a bunch of missing folding tags plus
98
99 /*
100 * Local variables:
101 * tab-width: 4
102 * c-basic-offset: 4
103 * End:
78747bd2 » Derick Rethans
2001-09-09 - Don't wrap lines... this is annoying while coding.
104 * vim600: sw=4 ts=4 fdm=marker
105 * vim<600: sw=4 ts=4
25c3a3a3 » rlerdorf
2001-06-05 vim-6 does folding - clean up a bunch of missing folding tags plus
106 */
Something went wrong with that request. Please try again.