PatchworkOS
Loading...
Searching...
No Matches
strnlen_s.c
Go to the documentation of this file.
1
#include <
stdint.h
>
2
#include <
string.h
>
3
4
size_t
strnlen_s
(
const
char
* s,
size_t
maxsize)
5
{
6
if
(s ==
NULL
)
7
{
8
return
0;
9
}
10
11
for
(
uint64_t
i = 0; i < maxsize; i++)
12
{
13
if
(s[i] ==
'\0'
)
14
{
15
return
i;
16
}
17
}
18
19
return
maxsize;
20
}
NULL
#define NULL
Pointer error value.
Definition
NULL.h:23
stdint.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
string.h
strnlen_s
size_t strnlen_s(const char *s, size_t maxsize)
Definition
strnlen_s.c:4
src
libstd
functions
string
strnlen_s.c
Generated by
1.9.8