num -= sizeof(random); memcpy(buf, random, sizeof(random)); buf += sizeof(random);
num -= sizeof(rand_buf); memcpy(buf, rand_buf, sizeof(rand_buf)); buf += sizeof(rand_buf);
static int cca_get_random_bytes(unsigned char* buf, int num)	{	long ret_code;	long reason_code;	long exit_data_length;	char exit_data[4];	char form[] = "RANDOM  ";	char random[8];	while(num >= sizeof(random))		{		randomNumberGenerate(&ret_code, &reason_code, &exit_data_length,			exit_data, form, random);		if (ret_code)			return 0;		num -= sizeof(random);		memcpy(buf, random, sizeof(random));		buf += sizeof(random);		}	if (num)		{		randomNumberGenerate(&ret_code, &reason_code, NULL, NULL,			form, random);		if (ret_code)			return 0;		memcpy(buf, random, num);		}	return 1;	}