-/* $NetBSD: roll.c,v 1.12 2008/02/24 02:58:33 dholland Exp $ */
+/* $NetBSD: roll.c,v 1.14 2012/06/19 05:35:32 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)roll.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: roll.c,v 1.12 2008/02/24 02:58:33 dholland Exp $");
+__RCSID("$NetBSD: roll.c,v 1.14 2012/06/19 05:35:32 dholland Exp $");
#endif
#endif /* not lint */
*/
int
-roll(ndie, nsides)
- int ndie, nsides;
+roll(int ndie, int nsides)
{
- int tot;
+ long tot;
tot = 0;
while (ndie--)
tot += (random() % nsides) + 1;
- return tot;
+ return (int)tot;
}