<URL: http://bugs.freeciv.org/Ticket/Display.html?id=10775 >
Patches s2_1-helptext-v4.diff and s2_1-helptext2.diff committed to
S2_1. Version that applies to trunk needed.
On 08/09/07, Egor Vyscrebentsov wrote:
> On Sat, 8 Sep 2007 Marko Lindqvist wrote:
> > insert_allows() a couple of lines later starts (over)writing from the
> > beginning of the buffer.
> Yes, wrong params of insert_allows(). Overwrites basic helptext also.
Handling of current index inside buffer should be rewritten (in
trunk). I don't like how we have to search end of exiting text every
time we add new line to helptext. But that's for another ticket.
> However, I don't understand why there should be zeroing of buffer
> inside insert_allows().
That just sets one byte, and is much safer than trusting that nobody
ever changes callers -or adds new one - so that first byte seen by
insert_allows() is not zero.
> PS. I thought that there was documented rule that we use my_snpritf()
> rather than s[n]printf, but I can't find anything now...
It should be quite obvious that when we have freeciv variant of some
standard function, it should be used. They are there for a reason.
Freeciv-dev mailing list