shithub: scc

ref: b9d7c95aa5bf9e06fc7d6a58cd5d0c600f128bf3
dir: /tests/libc/execute/0022-strnlen.c/

View raw version
#include <assert.h>
#include <stdio.h>
#include <string.h>

/*
output:
testing
done
end:
*/

int
main()
{
	puts("testing");
	assert(strnlen("", 2) == 0);
	assert(strnlen("abc", 10) == 3);
	assert(strnlen((char[3]) {"abc"}, 3) == 3);
	assert(strnlen("abc", 2) == 2);
	puts("done");

	return 0;
}