[rfk-dev] compiling rfk for 32-bit x86
David Griffith
dgriffi at cs.csubak.edu
Sun Nov 18 21:56:02 PST 2012
On Mon, 19 Nov 2012, David Wolever wrote:
> Alright, found the bug. Here's a reasonable patch to fix it (although I
> can't say with certainty that it's definitely the most reasonable):
>
> diff --git a/src/robotfindskitten.c b/src/robotfindskitten.c
> index 7074273..4afd34e 100644
> --- a/src/robotfindskitten.c
> +++ b/src/robotfindskitten.c
> @@ -354,7 +354,7 @@ void init ( unsigned int num ) {
> unsigned int i, j, temp;
>
> /* allocate memory */
> - if ( ! ( state.items = calloc ( num, sizeof ( screen_object ) ) ) ) {
> + if ( ! ( state.items = calloc ( num + 2, sizeof ( screen_object ) ) ) ) {
> fprintf ( stderr, "Cannot malloc.\n" );
> exit ( EXIT_FAILURE );
> }
Doesn't seem to work.
--
David Griffith
dgriffi at cs.csubak.edu
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
More information about the rfk-dev
mailing list