while (*index && count<variants) { if (*index == '|') { buffer[count] = index + 1; ++count; *index = 0; } ++index; } return buffer;
char * start = data; for(PRUint32 i = 0; i < variants; i++) { char * p = PL_strchr(start, '|'); if(p != NULL) *p = 0;  array[i] = PL_strdup(start); start = ++p; } return array;
static char** MakeStringArray(PRUint32 variants, char* data){	char** buffer = NULL;	char* index = data;	PRUint32 count = 0;	  if((variants == 0) || (data == NULL))    return NULL;	buffer = (char **)PR_Calloc(variants, sizeof(char *));	if(!buffer)	    return NULL;	buffer[count] = index;	++count;	while (*index && count<variants)	{		if (*index == '|')		{		  buffer[count] = index + 1;		  ++count;		  *index = 0;		}		++index;	}	return buffer;}