diff options
| author | Alexander Barton <alex@barton.de> | 2005-01-18 09:05:37 +0000 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2005-01-18 09:05:37 +0000 |
| commit | 6c5f4beb53d5e37fefe017cf28c513c44cfda1af (patch) | |
| tree | 31cef46aedf74dbe93622d0c045709b43bb35be3 /src | |
| parent | 26b0ddf200690284feea19cec47e092641b62b6d (diff) | |
| download | ngircd-6c5f4beb53d5e37fefe017cf28c513c44cfda1af.tar.gz ngircd-6c5f4beb53d5e37fefe017cf28c513c44cfda1af.zip | |
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 :-/
Diffstat (limited to 'src')
| -rw-r--r-- | src/portab/strlcpy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/portab/strlcpy.c b/src/portab/strlcpy.c index f77527a0..627b3218 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.3 2005/01/18 09:05:37 alex Exp $"; #include "imp.h" #include <string.h> @@ -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 |