-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strnlen.c
23 lines (20 loc) · 1.02 KB
/
ft_strnlen.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: shogura <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/14 20:54:55 by shogura #+# #+# */
/* Updated: 2022/04/14 20:55:11 by shogura ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strnlen(char *dst, size_t maxlen)
{
size_t len;
len = 0;
while (len < maxlen && dst[len])
len++;
return (len);
}