apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Kenneth Casson Leighton <l...@samba-tng.org>
Subject Re: [REPOST] printf and FMT values.
Date Thu, 10 May 2001 13:28:43 GMT
On Sat, Apr 28, 2001 at 08:51:52AM -0700, rbb@covalent.net wrote:
> 
> The ONLY way to print to stderr, stdout, stdin through APR is to call
> apr_open_std*.  This is because APR doesn't use stdio on Windows.  We use
> native I/O.  That means that APR on Windows doesn't have any idea what you
> mean by stdin, out, or err.
> 
> It is unfortunate, but that is what we are stuck with.

you may wish to do what samba does, here:

#define printf ERR_NEVER_USE_PRINTF_USE_XXX_INSTEAD
#define sprintf ERR_NEVER_USE_PRINTF_USE_XXX_INSTEAD
#define vsprintf ERR_NEVER_USE_PRINTF_USE_XXX_INSTEAD

etc.

the same thing is done for strcpy, strcat etc.

this forces the developer to use safe_strcpy, safe_strcat,
slprintf etc. which are line-limited versions of the same
functions.

luke

Mime
View raw message