[Freeciv-Dev] Re: [RFC] New event handling
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
On Tue, 23 Jan 2001, David Pfitzner wrote:
> > The client will prepare the arguments, retrieve the localized format
> > string and will vsnprintf it. There has to be some va_list magic.
> 
> I would suggest not using vsnprintf, but doing it "manually",
> which shouldn't be too hard since there should only by %d and %s
> and %% fields?  Oh, and %$2s or however that goes.  
%2$s
> That way you avoid va_list hassles, and can verify everything 
> as you go, which otherwise you would have to do anyway before
> calling vsnprintf() (since should not pass untrusted strings
> and args to vsnprintf()).
Yes, we are loosing the compiler checks of format string. I know. Anyway
SAS-C never had them :-)
Doing the va_list magic is much lower work than recreating the parser of
vsnprintf. I know, as I did this for Amiga port and I don't want to redo
this again.
This maybe done, if there are some systems which have serious problems
with the way I will implement the dynamic argument creation. We will see.
I don't expect any problems.
Ciao
 ____  _ _  ____  _ _    _ _  ____
|    |  |  |    |  | \  / |  |    | the cool Gremlin from Bischofswerda
|  __   |   ____|  |  \/  |  |    | WWW: http://home.pages.de/~stoecker/
|    |  |  |       |      |  |    | PGP key available on www page.
|____| _|_ |____| _|_    _|_ |____| I hope AMIGA never ends to make fun!
 
 
 
 | 
 |