Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: new natural names patch (PR#1127)
Home

[Freeciv-Dev] Re: new natural names patch (PR#1127)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: new natural names patch (PR#1127)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Sat, 22 Dec 2001 18:24:43 +0000 (GMT)

 --- Jason Short <vze2zq63@xxxxxxxxxxx> wrote: > Chris Richards wrote:
> 
> > Since the operation is destructive already, why not memmove the
> > contents to the beginning of the input address?  As it stands, the
> > return param has to save off an additional pointer or strdup the
> value
> > anyway--no re-using the input param.  So it is more like,
> > trim-and-copy than just trim.
> > 
> > Secondly, passing in a string that is str[0] = '\0' will blow-up your
> > reverse processing--you'll underrun your buffer with the str--;.
> 
> Good points.

But you want to memmove only if s1>s2 (i.e. there was some initial
whitespace)

G.


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


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