Sign in
llvm
/
llvm-archive
/
f91d1660b4827134c7666ae9637f21a2741d183f
/
.
/
safecode
/
test
/
cstdlib
/
strnlen-003.c
blob: e087819a1675bdf2e0362cc36220467c7b39a554 [
file
] [
log
] [
blame
]
// RUN: test.sh -p -t %t %s
#include
<string.h>
#include
<assert.h>
// Example of the correct usage of strnlen().
int
main
()
{
char
string
[
10
]
=
"A string"
;
size_t
result
;
result
=
strnlen
(
string
,
100
);
assert
(
result
==
8
);
return
0
;
}