if (srcstring[lpc++] == separator) { *name = (char*)crm_malloc(sizeof(char)*lpc); strncpy(*name, srcstring, lpc-1); (*name)[lpc-1] = '\0';
if (srcstring[lpc] == separator || srcstring[lpc] == '\0') { *name = (char*)crm_malloc(sizeof(char)*lpc+1); strncpy(*name, srcstring, lpc); (*name)[lpc] = '\0';
decodeNVpair(const char *srcstring, char separator, char **name, char **value){	int lpc = 0;	int len = 0;	const char *temp = NULL;		crm_verbose("Attempting to decode: [%s]", srcstring);	if (srcstring != NULL) {		len = strlen(srcstring);		while(lpc < len) {			if (srcstring[lpc++] == separator) {				*name = (char*)crm_malloc(sizeof(char)*lpc);				strncpy(*name, srcstring, lpc-1);				(*name)[lpc-1] = '\0';				// this sucks but as the strtok *is* a bug				len = len-lpc+1;				*value = (char*)crm_malloc(sizeof(char)*len);				temp = srcstring+lpc;				strncpy(*value, temp, len-1);				(*value)[len-1] = '\0';				return TRUE;			}		}	}	*name = NULL;	*value = NULL;    	return FALSE;}