tests/test_token.c
int ns_initparse(const u_char *nsbuf, int l, ns_msg *msg_handle)
{
	UNUSED(l);
	char *buf = (char*) nsbuf;
	char *next;
	int i, count = 0;

	msg_handle->_msg_ptr = nsbuf;
	while (true)
	{
		if (buf[0] == 0)
			break;
		count++;
		next = strchr (buf, '\n');
		if (NULL == next)
			break;
		*next = 0;
		buf = ++next;
	}
	for (i=0; i<ns_s_max; i++) {
		if (i == ns_s_an)
			msg_handle->_counts[i] = count;
		else
			msg_handle->_counts[i] = 0;
	}
	return 0;
}
// These mocks assume that the pieces of a dns txt record end with '\n';
These mocks assume that the pieces of a dns txt record end with '\n'.
These mocks assume that the pieces of a dns txt record end with ' \ n ' .
int ns_initparse(const u_char *nsbuf, int l, ns_msg *msg_handle)
{
	UNUSED(l);
	char *buf = (char*) nsbuf;
	char *next;
	int i, count = 0;
	msg_handle->_msg_ptr = nsbuf;
	while (true)
	{
		if (buf[0] == 0)
			break;
		count++;
		next = strchr (buf, '\n');
		if (NULL == next)
			break;
		*next = 0;
		buf = ++next;
	}
	for (i=0; i<ns_s_max; i++) {
		if (i == ns_s_an)
			msg_handle->_counts[i] = count;
		else
			msg_handle->_counts[i] = 0;
	}
	return 0;
}
int ns_initparse ( const u_char * nsbuf , int l , ns_msg * msg_handle ) { UNUSED ( l ) ; char * buf = ( char * ) nsbuf ; char * next ; int i , count = 0 ; msg_handle -> _msg_ptr = nsbuf ; while ( true ) { if ( buf [ 0 ] == 0 ) break ; count ++ ; next = strchr ( buf , ' \n ' ) ; if ( NULL == next ) break ; * next = 0 ; buf = ++ next ; } for ( i = 0 ; i < ns_s_max ; i ++ ) { if ( i == ns_s_an ) msg_handle -> _counts [ i ] = count ; else msg_handle -> _counts [ i ] = 0 ; } return 0 ; }
These mocks assume that the pieces of a dns txt record end with '\n';
These mocks assume that the pieces of a dns txt record end with ' \ n ' ;