[Openal] Warning for non secure sprintf on VS2008!

StApostol stapostol at gmail.com
Mon Jul 20 00:23:33 PDT 2009


The function 'sprintf_s' is a non-standard Microsoft extension to C89. As
such, it cannot be used if cross-compiler support is desired. Easiest
solution: turn off warnings for "security deprecations" in your compiler.

The C99 standard includes a safe alternative in the form of snprintf.



On Mon, Jul 20, 2009 at 10:04 AM, Ümit Uzun <umituzun84 at gmail.com> wrote:

> Hi All,
>
> New version of OpenAL11CoreSDK<http://connect.creativelabs.com/openal/Downloads/OpenAL11CoreSDK.zip>has updated for secure file and console operations. But there is sprintf
> which omitted about this changing I think. When I build new version
> framework I have get warning about security on VS2008, I think sprintf
> should be changed to sprintf_s as follows;
>
> ALchar *ALFWaddMediaPath(const ALchar *filename)
> {
>     // sprintf(fullPath, "%s%s", "..\\..\\Media\\", filename); Obsolete one
>     sprintf_s(fullPath, _MAX_PATH, "%s%s", "..\\..\\Media\\", filename);
>     return fullPath;
> }
>
> Regards.
>
> Ümit Uzun
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20090720/cf97b359/attachment.html


More information about the Openal mailing list