aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-01-24 04:32:46 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-01-24 11:06:36 +0000
commit6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9 (patch)
treea5b7486776fb96122db515709c552a6e691fd24d /lib/libc
parent97a463120bf99819fcb21a781e410fb43dde2a43 (diff)
downloadsrc-6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9.tar.gz
src-6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9.zip
libc: remove open-coded strlen in _gettemp
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/mktemp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index f64eda748d0b..c47e0221e5cd 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -131,8 +131,7 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags)
return (0);
}
- for (trv = path; *trv != '\0'; ++trv)
- ;
+ trv = path + strlen(path);
if (trv - path >= MAXPATHLEN) {
errno = ENAMETOOLONG;
return (0);