diff options
Diffstat (limited to 'lib/libpam/openpam_strlcpy.h')
| -rw-r--r-- | lib/libpam/openpam_strlcpy.h | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/libpam/openpam_strlcpy.h b/lib/libpam/openpam_strlcpy.h index 9c6554834830..8260c5627e0d 100644 --- a/lib/libpam/openpam_strlcpy.h +++ b/lib/libpam/openpam_strlcpy.h @@ -6,8 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -27,26 +26,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_strlcpy.h 578 2012-04-06 00:45:59Z des $ + * $Id: openpam_strlcpy.h 648 2013-03-05 17:54:27Z des $ */ #ifndef OPENPAM_STRLCPY_H_INCLUDED #define OPENPAM_STRLCPY_H_INCLUDED #ifndef HAVE_STRLCPY -/* like strcpy(3), but always NUL-terminates; returns strlen(src) */ -static size_t -strlcpy(char *dst, const char *src, size_t size) -{ - size_t len; - - for (len = 0; *src && size > 1; ++len, --size) - *dst++ = *src++; - *dst = '\0'; - while (*src) - ++len, ++src; - return (len); -} +size_t openpam_strlcpy(char *, const char *, size_t); +#undef strlcpy +#define strlcpy(arg, ...) openpam_strlcpy(arg, __VA_ARGS__) #endif #endif |
