openbsd-ports/graphics/aalib/patches/patch-src_aafire_c
simon 1c7cd32f95 add missing includes to prevent segfaults
looks sane to ajacoutot@
2009-02-09 10:48:51 +00:00

45 lines
1.3 KiB
Plaintext

$OpenBSD: patch-src_aafire_c,v 1.2 2009/02/09 10:48:51 simon Exp $
--- src/aafire.c.orig Thu Apr 26 17:30:03 2001
+++ src/aafire.c Mon Feb 9 00:52:20 2009
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include "aalib.h"
#define XSIZ aa_imgwidth(context)
@@ -48,6 +49,7 @@ static void
initialize (void)
{
int i;
+ srandomdev();
context = aa_autoinit (&aa_defparams);
if (context == NULL)
{
@@ -114,20 +116,20 @@ drawfire (void)
height++;
loop--;
if (loop < 0)
- loop = rand () % 3, sloop++;;
+ loop = random () % 3, sloop++;;
i1 = 1;
i2 = 4 * XSIZ + 1;
for (p = (char *) bitmap + XSIZ * (YSIZ + 0);
p < ((unsigned char *) bitmap + XSIZ * (YSIZ + 1));
p++, i1 += 4, i2 -= 4)
{
- last1 = rand () % min (i1, min (i2, height));
- i = rand () % 6;
+ last1 = random () % min (i1, min (i2, height));
+ i = random () % 6;
for (; p < (unsigned char *) bitmap + XSIZ * (YSIZ + 1) && i != 0;
p++, i--, i1 += 4, i2 -= 4)
- *p = last1, last1 += rand () % 6 - 2, *(p + XSIZ) = last1, last1 +=
- rand () % 6 - 2;
- *(p + 2 * XSIZ) = last1, last1 += rand () % 6 - 2;
+ *p = last1, last1 += random () % 6 - 2, *(p + XSIZ) = last1, last1 +=
+ random () % 6 - 2;
+ *(p + 2 * XSIZ) = last1, last1 += random () % 6 - 2;
}
i = 0;
firemain ();