snprintf() confusion
Posted Feb 7, 2004 10:00 UTC (Sat) by
ThePythonicCow (subscriber, #11308)
In reply to:
snprintf() confusion by giraffedata
Parent article:
snprintf() confusion
I doubt the wasted computation entered into the decision.
Hmmmm ... I feel we are both guessing slightly off. You're likely
right it wasn't an explicit decision to save cpu cycles. But the
analogy with printf is fragile as well - it's not like printf has
a choice of two possible lengths to choose from. It writes whatever
it has format for, and counts it all (or SEGV's trying).
Your last words:
is actually quite unconventional
might
come closest to the mark. Something about the modern value just
seems odd. The early snprintf creators perhaps didn't even consider
that choice of return value as an alternative.
(
Log in to post comments)