diff options
author | nectar <nectar@FreeBSD.org> | 2003-05-01 19:03:14 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2003-05-01 19:03:14 +0000 |
commit | 0b64e1476ba01c6ba095af7d0623e93362281a12 (patch) | |
tree | 736595316c161b3d1ae559f331feaa6ba12b500e /lib/libc/stdlib/realpath.c | |
parent | 5ce8f7673e9083fdec888025823478cd3faf1ed7 (diff) | |
download | FreeBSD-src-0b64e1476ba01c6ba095af7d0623e93362281a12.zip FreeBSD-src-0b64e1476ba01c6ba095af7d0623e93362281a12.tar.gz |
Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.
Diffstat (limited to 'lib/libc/stdlib/realpath.c')
-rw-r--r-- | lib/libc/stdlib/realpath.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 93a9856..c269471 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -67,14 +67,14 @@ realpath(const char *path, char resolved[PATH_MAX]) if (path[1] == '\0') return (resolved); resolved_len = 1; - left_len = _strlcpy(left, path + 1, sizeof(left)); + left_len = strlcpy(left, path + 1, sizeof(left)); } else { if (getcwd(resolved, PATH_MAX) == NULL) { - _strlcpy(resolved, ".", PATH_MAX); + strlcpy(resolved, ".", PATH_MAX); return (NULL); } resolved_len = strlen(resolved); - left_len = _strlcpy(left, path, sizeof(left)); + left_len = strlcpy(left, path, sizeof(left)); } if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) { errno = ENAMETOOLONG; @@ -131,7 +131,7 @@ realpath(const char *path, char resolved[PATH_MAX]) * lstat() fails we still can return successfully if * there are no more path components left. */ - resolved_len = _strlcat(resolved, next_token, PATH_MAX); + resolved_len = strlcat(resolved, next_token, PATH_MAX); if (resolved_len >= PATH_MAX) { errno = ENAMETOOLONG; return (NULL); @@ -177,13 +177,13 @@ realpath(const char *path, char resolved[PATH_MAX]) symlink[slen] = '/'; symlink[slen + 1] = 0; } - left_len = _strlcat(symlink, left, sizeof(left)); + left_len = strlcat(symlink, left, sizeof(left)); if (left_len >= sizeof(left)) { errno = ENAMETOOLONG; return (NULL); } } - left_len = _strlcpy(left, symlink, sizeof(left)); + left_len = strlcpy(left, symlink, sizeof(left)); } } |