Boost logo

Boost :

From: Jim Douglas (jim_at_[hidden])
Date: 2006-01-30 04:54:31


Reece Dunn wrote:
> Normally, in C (or even some C++ code), you have constructs that look like
> this:
>
> char buffer[ 15 ];
> sprintf( buffer, "Some %s text", "verly long" );

No self-respecting coding standard would allow you to write the code
above. Rather it would insist that at least you wrote:

     snprintf( buffer, 15, "Some %s text", "verly long" );

Does that not solve the problem of overruns?

Jim


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk