aboutsummaryrefslogtreecommitdiff
path: root/fs/nsfs.c
diff options
context:
space:
mode:
authorAmmar Faizi2022-03-29 17:17:36 +0700
committerPaul E. McKenney2022-04-20 17:05:46 -0700
commitb26823c19a12d9a06207ad3051e3d1059a9e1005 (patch)
tree2556910069b586e8f75c67efbbdf675191b69031 /fs/nsfs.c
parent0e0ff638400be8f497a35b51a4751fd823f6bd6a (diff)
tools/nolibc/string: Implement `strnlen()`
size_t strnlen(const char *str, size_t maxlen); The strnlen() function returns the number of bytes in the string pointed to by sstr, excluding the terminating null byte ('\0'), but at most maxlen. In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by str and never beyond str[maxlen-1]. The first use case of this function is for determining the memory allocation size in the strndup() function. Link: https://lore.kernel.org/lkml/CAOG64qMpEMh+EkOfjNdAoueC+uQyT2Uv3689_sOr37-JxdJf4g@mail.gmail.com Suggested-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'fs/nsfs.c')
0 files changed, 0 insertions, 0 deletions