X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibspl%2Fstrlcpy.c;fp=lib%2Flibspl%2Fstrlcpy.c;h=0000000000000000000000000000000000000000;hb=6b2c60acca39ef3468797095d3a4162e6ce69786;hp=7a8009b893e3896e91cbc83d6aa2d1a54ec1292f;hpb=a4076c7544bdbdc0ac0fe20f4ef86c2aa06862fb;p=zfs.git diff --git a/lib/libspl/strlcpy.c b/lib/libspl/strlcpy.c deleted file mode 100644 index 7a8009b..0000000 --- a/lib/libspl/strlcpy.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "lint.h" -#include -#include - -/* - * Copies src to the dstsize buffer at dst. The copy will never - * overflow the destination buffer and the buffer will always be null - * terminated. - */ - -size_t -strlcpy(char *dst, const char *src, size_t len) -{ - size_t slen = strlen(src); - size_t copied; - - if (len == 0) - return (slen); - - if (slen >= len) - copied = len - 1; - else - copied = slen; - (void) memcpy(dst, src, copied); - dst[copied] = '\0'; - return (slen); -}