[Freeciv-Dev] Re: C99 vsnprintf().
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
David Pfitzner <dwp@xxxxxxxxxxxxxx> writes:
> gs234@xxxxxxxxx (Gaute (B) Strokkenes) wrote:
>
> > Requiring strict adherence to C99 is a in my opinion a bit harsh,
> > since there are a lot of systems around with perfectly good
> > vsnprintf()'s except for the fact that they do not return the number
> > of byte written.
>
> To be precise again, the correct return value is not the number
> of bytes written, but the number of bytes which would have been
> written if the user-specified n was large enough to avoid
> trunctation.
Err, um, yes, you are obviously right. I wonder what they put in the
noodles last night...
> OTOH I agree that its an open question whether we really need
> this functionality of the return value.
That's my thinking. Basically, I just counted the number of places in
the source where the return value was stored somewhere. If we narrow
down to the number of places where it is used to do something
meaningful, the number is even smaller (2, after a very cursory
examination.) I think that I can easily produce a patch that works
around this.
> My thinking is that 64k is small compared to the rest of freeciv.
> That is, if you have enough memory to usefully run freeciv, then
> 64k is not much more.
Probably right, but it's a slippery slope.
--
Big Gaute (not to be confused with LG)
Oh, I get it!! ``The BEACH goes on,'' huh, SONNY??
|
|