Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: Improved game starting (version 8)
Home

[Freeciv-Dev] Re: Improved game starting (version 8)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Christian Knoke <ChrisK@xxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Improved game starting (version 8)
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Sun, 20 Jan 2002 16:41:08 -0500 (EST)

> > > 595       write(stdin_pipe[1],"cmdlevel hack first\n",14);
> > > 596       c=0;
> > > 597       while(!read(stdout_pipe[0],&c,1) || c!='>'); /*Wait for 
> > > responce from the server*/
> > >
> >
> > Hmm, I still have no problem, even with the game you supplied.
> >
> > Try replacing line 597 with
> > while(!read(stdout_pipe[0],&c,1) || c!='>') fprintf(stderr,"<%c>",c);
> > and see what gets output.
>
> The output is:
> !@#$%^<c><m><d><l><e><v><e><l>< ><h><a><c><k>< >

Maybe if you tried

while((read(stdout_pipe[0], &c, 1) == 1) || (c != '>'))

That way you'd catch any read errors, too.

-jdm

Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin@xxxxxxxxxxx



[Prev in Thread] Current Thread [Next in Thread]