[Pcsclite-cvs-commit] CVS libmusclecard/src
CVS User rousseau
ludovic.rousseau@free.fr
Thu, 21 Apr 2005 09:25:30 +0000
Update of /cvsroot/pcsclite/libmusclecard/src
In directory haydn:/tmp/cvs-serv7344
Modified Files:
strlcat.c strlcpy.c
Log Message:
declare the functions as INTERNAL
define them only if HAVE_STRLCAT/HAVE_STRLCPY is not defined
--- /cvsroot/pcsclite/libmusclecard/src/strlcat.c 2004/10/06 08:51:49 1.1
+++ /cvsroot/pcsclite/libmusclecard/src/strlcat.c 2005/04/21 09:25:30 1.2
@@ -16,12 +16,16 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+#ifndef HAVE_STRLCAT
+
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <string.h>
+#include "misc.h"
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
@@ -30,7 +34,7 @@
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
-size_t
+INTERNAL size_t
strlcat(char *dst, const char *src, size_t siz)
{
register char *d = dst;
@@ -57,3 +61,6 @@
return(dlen + (s - src)); /* count does not include NUL */
}
+
+#endif
+
--- /cvsroot/pcsclite/libmusclecard/src/strlcpy.c 2004/10/06 08:51:49 1.1
+++ /cvsroot/pcsclite/libmusclecard/src/strlcpy.c 2005/04/21 09:25:30 1.2
@@ -16,19 +16,23 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+#ifndef HAVE_STRLCPY
+
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <string.h>
+#include "misc.h"
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-size_t
+INTERNAL size_t
strlcpy(char *dst, const char *src, size_t siz)
{
register char *d = dst;
@@ -53,3 +57,6 @@
return(s - src - 1); /* count does not include NUL */
}
+
+#endif
+