From 6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sun, 24 Jan 2021 05:32:46 +0100 Subject: libc: remove open-coded strlen in _gettemp --- lib/libc/stdio/mktemp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libc') 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); -- cgit v1.2.3