X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fportab%2Fstrlcpy.c;h=1f86a93304fcec3d2246374d3fe2d7815fca638e;hp=5e2c72228c1c6429d85f290abc0a4cd5e225f4c7;hb=b71a0ddbd570f5163ede198d635c3b03abd3e27e;hpb=3da942e2374449248b1359222564db8f9997b090 diff --git a/src/portab/strlcpy.c b/src/portab/strlcpy.c index 5e2c7222..1f86a933 100644 --- a/src/portab/strlcpy.c +++ b/src/portab/strlcpy.c @@ -1,14 +1,20 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2005 Alexander Barton (alex@barton.de) + * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * + */ + +#include "portab.h" + +/** + * @file * strlcpy() and strlcat() replacement functions. + * * See for details. * * Code partially borrowed from compat.c of rsync, written by Andrew @@ -16,22 +22,13 @@ * */ - -#include "portab.h" - -static char UNUSED id[] = "$Id: strlcpy.c,v 1.4 2005/02/27 09:29:13 alex Exp $"; - -#include "imp.h" #include #include -#include "exp.h" - - #ifndef HAVE_STRLCAT GLOBAL size_t -strlcat( CHAR *dst, CONST CHAR *src, size_t size ) +strlcat( char *dst, const char *src, size_t size ) { /* Like strncat() but does not 0 fill the buffer and * always null terminates. */ @@ -51,11 +48,10 @@ strlcat( CHAR *dst, CONST CHAR *src, size_t size ) #endif - #ifndef HAVE_STRLCPY GLOBAL size_t -strlcpy( CHAR *dst, CONST CHAR *src, size_t size ) +strlcpy( char *dst, const char *src, size_t size ) { /* Like strncpy but does not 0 fill the buffer and * always null terminates. */ @@ -73,5 +69,4 @@ strlcpy( CHAR *dst, CONST CHAR *src, size_t size ) #endif - /* -eof- */