~case/dbns

1de6d07024c06d7892ab8f8c495a4ff76aee8b03 — case 4 years ago 97e5647
arc4random -> random
2 files changed, 8 insertions(+), 8 deletions(-)

M src/act_comm.c
M src/db.c
M src/act_comm.c => src/act_comm.c +2 -2
@@ 224,7 224,7 @@ translate(int percent, const char *in, const char *name)
	for (pbuf = in; *pbuf;) {
		for (cnv = lng->first_precnv; cnv; cnv = cnv->next) {
			if (!str_prefix(cnv->old, pbuf)) {
			  if (percent && (int)(arc4random() % 100) < percent) {
			  if (percent && (int)(random() % 100) < percent) {
					strncpy(pbuf2, pbuf, cnv->olen);
					pbuf2[cnv->olen] = '\0';
					pbuf2 += cnv->olen;


@@ 237,7 237,7 @@ translate(int percent, const char *in, const char *name)
			}
		}
		if (!cnv) {
		  if (isalpha(*pbuf) && (!percent || (int)(arc4random() % 100) > percent)) {
		  if (isalpha(*pbuf) && (!percent || (int)(random() % 100) > percent)) {
				*pbuf2 = lng->alphabet[LOWER(*pbuf) - 'a'];
				if (isupper(*pbuf))
					*pbuf2 = UPPER(*pbuf2);

M src/db.c => src/db.c +6 -6
@@ 4115,24 4115,24 @@ number_fuzzy(int number)

/*
 * Generate a random number.
 * Ooops was (arc4random() % to) + from which doesn't work -Shaddai
 * Ooops was (random() % to) + from which doesn't work -Shaddai
 */
int
number_range(int from, int to)
{
	if ((to - from) < 1)
		return from;
	return ((arc4random() % (to - from + 1)) + from);
	return ((random() % (to - from + 1)) + from);
}

/*
 * Generate a percentile roll.
 * arc4random() % 100 only does 0-99, changed to do 1-100 -Shaddai
 * random() % 100 only does 0-99, changed to do 1-100 -Shaddai
 */
int
number_percent(void)
{
	return (arc4random() % 100) + 1;
	return (random() % 100) + 1;
}




@@ 4144,7 4144,7 @@ number_door(void)
{
	int 	door;

	while ((door = arc4random() & (16 - 1)) > 9);
	while ((door = random() & (16 - 1)) > 9);

	return door;
}


@@ 4154,7 4154,7 @@ number_door(void)
int
number_bits(int width)
{
	return arc4random() & ((1 << width) - 1);
	return random() & ((1 << width) - 1);
}

/*