mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Make minor improvements
This commit is contained in:
parent
04caf6f9ad
commit
95b142e4e5
95 changed files with 3818 additions and 2760 deletions
|
@ -71,11 +71,15 @@ TEST(strnlen, testconst) {
|
|||
}
|
||||
|
||||
TEST(strlen, testnonconst) {
|
||||
/* this test case is a great example of why we need:
|
||||
"m"(*(char(*)[0x7fffffff])StR)
|
||||
rather than:
|
||||
"m"(*StR) */
|
||||
char buf[256];
|
||||
unsigned i;
|
||||
for (i = 0; i < 255; ++i) buf[i] = i + 1;
|
||||
for (i = 0; i < 250; ++i) buf[i] = i + 1;
|
||||
buf[i] = '\0';
|
||||
ASSERT_EQ(255, strlen(buf));
|
||||
ASSERT_EQ(250, strlen(buf));
|
||||
}
|
||||
|
||||
TEST(strnlen_s, null_ReturnsZero) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue