X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Pb with sprintf Date: 8 Sep 2005 11:59:17 GMT Lines: 17 Message-ID: <3oanclF4upp5U2@news.dfncis.de> References: <2497d9a2050907160124a508c7 AT mail DOT gmail DOT com> <3oak7kF50c1lU2 AT news DOT dfncis DOT de> X-Trace: news.dfncis.de 4cXTvtUKNqhUwECJd+3lXQu6vJgUitkq55eXPmVQJCP5+uUhkFPO7u9W76 X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Joe Wright wrote: > What could sprintf() do with malloc()? Construct itself a temporary buffer to work in --- the output buffer may not be large enough. If sprintf() were a standalone "real" function that does all the work itself, it probably wouldn't need that. But in modern C runtimes, sprintf() may well be a specialization of vsnprintf(), which may a need a buffer to do its job. Or sprintf() could be implemented via an in-memory pseudo file, i.e. it may need to construct a FILE * to pass to the underlying generic routines. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.