Csound Csound-dev Csound-tekno Search About

[Cs-dev] Are there objection to snprintf?

Date2014-01-24 19:20
Fromjohn 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

Date2014-01-24 19:43
FromMichael Gogins
SubjectRe: [Cs-dev] Are there objection to snprintf?
AttachmentsNone  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 Gogins
Irreducible 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
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
https://lists.sourceforge.net/lists/listinfo/csound-devel