diff --git a/ChangeLog b/ChangeLog index 1c905513..0ff6296e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ ngIRCd - Next Generation IRC Server - (c)2001-2004 by Alexander Barton, + (c)2001-2005 by Alexander Barton, alex@barton.de, http://www.barton.de/ ngIRCd is free software and published under the @@ -10,6 +10,13 @@ -- ChangeLog -- +ngircd 0.8.x (CVS) + + - Fixed return values of our own implementation of strlcpy(). The code has + been taken from rsync and they fixed it, but we didn't until today :-/ + It has only been used when the system didn't implement strlcpy by itself, + not on "modern" systems. Florian Westphal, . + ngircd 0.8.1 (2004-12-25) - Autoconf: Updated config.guess and config.sub @@ -540,4 +547,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.233.2.11 2004/12/25 00:20:57 alex Exp $ +$Id: ChangeLog,v 1.233.2.12 2005/01/18 09:09:05 alex Exp $ diff --git a/src/portab/strlcpy.c b/src/portab/strlcpy.c index f77527a0..10527d03 100644 --- a/src/portab/strlcpy.c +++ b/src/portab/strlcpy.c @@ -19,7 +19,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: strlcpy.c,v 1.2 2002/12/26 14:34:11 alex Exp $"; +static char UNUSED id[] = "$Id: strlcpy.c,v 1.2.4.1 2005/01/18 09:09:05 alex Exp $"; #include "imp.h" #include @@ -61,12 +61,13 @@ strlcpy( CHAR *dst, CONST CHAR *src, size_t size ) * always null terminates. */ size_t len = strlen( src ); + size_t ret = len; - if( size <= 0 ) return len; + if( size <= 0 ) return 0; if( len >= size ) len = size - 1; memcpy( dst, src, len ); dst[len] = 0; - return len; + return ret; } /* strlcpy */ #endif