[Cs-dev] Are there objection to snprintf?
Date | 2014-01-24 19:20 |
From | john ffitch |
Subject | [Cs-dev] Are there objection to snprintf? |
The snprintf function is much safer than sprintf but is a C99 function and I am not sure that it is implemented on all platforms. Does anyone have strong feelings against its use? ==John ffitch ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2014-01-24 19:43 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Are there objection to snprintf? |
Attachments | None None |
One strategy often followed in Unix/Linux programming is to test for snprintf at configuration time, then if it is not present, supply our own implementation of the function. This usually works best if cases are simple, but this case is simple. Sources for snprintf from existing implementations can be adapted. This is what I recommend. Best, Mike ----------------------------------------------------- Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Fri, Jan 24, 2014 at 2:20 PM, john ffitch <jpff@codemist.co.uk> wrote: The snprintf function is much safer than sprintf but is a C99 function |