Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Are bad developer libraries the problem with M$ software?

From: Ben Pfaff <blp(at)cs.stanford.edu>
Date: Thu Nov 14 2002 - 19:22:38 EST

Jason Lunz <lunz@falooley.org> writes:

> mikal@stillhq.com said:

That's also true of some other C libraries, e.g., glibc before 2.1. The "return the needed size" is new in C99's specification of sprintf() as far as I know. C90 did not have sprintf() at all.

Myself, I code defensively around this. It's not hard to write code that can handle either form of return value. If a value as large as your buffer size or larger is returned, reallocate your buffer exactly and try again; if -1 is returned, double (or whatever) the buffer size and try again; otherwise, everything's fine.

-- 
"...I've forgotten where I was going with this,
 but you can bet it was scathing."
--DesiredUsername
Received on Sun Nov 17 02:09:50 2002

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:44 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library