sync
This commit is contained in:
parent
b725114422
commit
56e8571167
43
strlfun.c
43
strlfun.c
@ -1,32 +1,34 @@
|
||||
/* $MirOS: src/bin/mksh/strlfun.c,v 1.7 2006/11/09 15:02:31 tg Exp $ */
|
||||
/* _MirOS: src/lib/libc/string/strlfun.c,v 1.10 2006/11/08 23:18:04 tg Exp $ */
|
||||
/* $MirOS: src/bin/mksh/strlfun.c,v 1.8 2007/01/09 17:34:21 tg Exp $ */
|
||||
/* $miros: src/lib/libc/string/strlfun.c,v 1.14 2007/01/07 02:11:40 tg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006
|
||||
* Thorsten Glaser <tg@mirbsd.de>
|
||||
*
|
||||
* Licensee is hereby permitted to deal in this work without restric-
|
||||
* tion, including unlimited rights to use, publicly perform, modify,
|
||||
* merge, distribute, sell, give away or sublicence, provided all co-
|
||||
* pyright notices above, these terms and the disclaimer are retained
|
||||
* in all redistributions or reproduced in accompanying documentation
|
||||
* or other materials provided with binary redistributions.
|
||||
*
|
||||
* Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
|
||||
* express, or implied, to the maximum extent permitted by applicable
|
||||
* law, without malicious intent or gross negligence; in no event may
|
||||
* licensor, an author or contributor be held liable for any indirect
|
||||
* or other damage, or direct damage except proven a consequence of a
|
||||
* direct error of said person and intended use of this work, loss or
|
||||
* other issues arising in any way out of its use, even if advised of
|
||||
* the possibility of such damage or existence of a defect.
|
||||
* This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
|
||||
* the utmost extent permitted by applicable law, neither express nor
|
||||
* implied; without malicious intent or gross negligence. In no event
|
||||
* may a licensor, author or contributor be held liable for indirect,
|
||||
* direct, other damage, loss, or other issues arising in any way out
|
||||
* of dealing in the work, even if advised of the possibility of such
|
||||
* damage or existence of a defect, except proven that it results out
|
||||
* of said person's immediate fault when using the work as intended.
|
||||
*-
|
||||
* The strlcat() code below has been written by Thorsten Glaser. Bodo
|
||||
* Eggert suggested optimising the strlcpy() code, originally written
|
||||
* by Todd C. Miller (see below), which was carried out by Th. Glaser
|
||||
* as well as writing wcslcat() and wcslcpy() equivalents.
|
||||
* as well as merging this code with strxfrm() for ISO-10646-only sy-
|
||||
* stems and writing wcslcat(), wcslcpy() and wcsxfrm() equivalents.
|
||||
*/
|
||||
|
||||
#ifdef STRXFRM
|
||||
#undef HAVE_STRLCPY
|
||||
#undef HAVE_STRLCAT
|
||||
#define HAVE_STRLCPY 0
|
||||
#define HAVE_STRLCAT 1
|
||||
#define strlcpy strxfrm
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||
#include <lib/libkern/libkern.h>
|
||||
@ -41,7 +43,6 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
#endif
|
||||
extern size_t strlen(const char *);
|
||||
#endif
|
||||
|
||||
#ifndef __RCSID
|
||||
@ -71,7 +72,9 @@ extern size_t strlen(const char *);
|
||||
#define __predict_false(exp) ((exp) != 0)
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/strlfun.c,v 1.7 2006/11/09 15:02:31 tg Exp $");
|
||||
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||
__RCSID("$MirOS: src/bin/mksh/strlfun.c,v 1.8 2007/01/09 17:34:21 tg Exp $");
|
||||
#endif
|
||||
|
||||
size_t strlcpy(char *, const char *, size_t);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user