Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Possible bug in code.

Author: Tim Foden

Date: 04:03:25 08/14/03

Go up one level in this thread


On August 14, 2003 at 06:43:38, Joost Buijs wrote:

>You can try something like this:
>
>#include <stdio.h>
>#include <stdlib.h>
>#include <string.h>
>
>int queens[9][2];
>int rooks[10][2];
>int bishops[10][2];
>int knights[10][2];
>int pawns[8][2];
>
>void WriteArrays(int nodes)
>{
>	char fname[14];
>	FILE *fp;
>
>	sprintf(fname,"Movei%d.d",nodes);

Possible buffer overrun here... nodes my well be > 9999  :)  Looking at other
posts of Uri's, numbers like "213,298,603" were quoted.  Safer maybe to make
fname at least 20 chars long.  (same problem in CompareArray() too.)

Cheers, Tim.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.