All pastes #139877 Raw Edit

Unnamed

public text v1 · immutable
#139877 ·published 2006-08-20 04:39 UTC
rendered paste body
char tmpbuf[1024];

void strsplit(const char *str, char splitchar, int token_num, char *where)
{
	strncpy(str, tmpbuf, 1024);
	char *ptr = tmpbuf;
	
	int i;
	for (i = 0; i < token_num; i++)
		ptr += strchr(ptr, splitchar);
	
	strcpy(tmpbuf, where);
}