Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Fwd: Re: Re: Request (PR#939)
Home

[Freeciv-Dev] Re: Fwd: Re: Re: Request (PR#939)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Fwd: Re: Re: Request (PR#939)
From: Paul Zastoupil <paulz@xxxxxxxxxxxx>
Date: Thu, 6 Sep 2001 22:05:00 -0700

On Thu, Sep 06, 2001 at 06:37:47PM -0700, Trent Piepho wrote:
> On Thu, 6 Sep 2001, Paul Zastoupil wrote:
> > 
> > And a new version using mystrlcpy. [shown below]
> 
> static void wall(char *str)
> {
>   char wallbuffer[2048];
>   mystrlcpy(wallbuffer, str, sizeof(wallbuffer));
>   notify_conn_ex(&game.game_connections,-1,-1,E_MESSAGE_WALL,
>                  _("Server Operator: %s"),wallbuffer);
> }
> 
> 
> Why is it that you need to copy the string at all?  What's wrong with
> this?
> 
> static void wall(char *str) 
> { 
>   notify_conn_ex(&game.game_connections,-1,-1,E_MESSAGE_WALL, 
>                  _("Server Operator: %s"),str); 
> }

Well, I guess because we don't know that str is safe?

-- 
Paul Zastoupil


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