[Python-Dev] snprintf breaks build

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Fri, 4 Aug 2000 07:30:59 +0300 (IDT)


On Thu, 3 Aug 2000, Fred L. Drake, Jr. wrote:

>   Hmm.  I think the issue with known existing snprintf()
> implementations with Open Source licenses was that they were at least
> somewhat contanimating.  I'll switch back to sprintf() until we have a
> portable snprintf() implementation.

Fred -- in your case, there is no need for sprintf -- a few sizeof(long)s
along the way would make sure that your buffers are large enough.  (For
extreme future-proofing, you might also sizeof() the messages you print)

(Tidbit: since sizeof(long) measures in bytes, and %d prints in decimals,
then a buffer of length sizeof(long) is enough to hold a decimal
represntation of a long).

--
Moshe Zadka <moshez@math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez