Boost C++ Libraries: Ticket #3085: Fixed-size buffers and strncpy https://svn.boost.org/trac10/ticket/3085 <p> Fixed-size buffers and strncpy really don't belong in an example of a Boost lib... ;) </p> <p> boost_1_39_0\libs\spirit\classic\example\fundamental\comments.cpp: </p> <pre class="wiki">void actor_cpp (const char *pfirst, const char *plast) { cout &lt;&lt; "Parsing C++-comment" &lt;&lt;endl; cout &lt;&lt; "Matched (" &lt;&lt; plast-pfirst &lt;&lt; ") characters: "; char cbbuffer[128]; strncpy(cbbuffer, pfirst, plast-pfirst); cbbuffer[plast-pfirst] = '\0'; cout &lt;&lt; "\"" &lt;&lt; cbbuffer &lt;&lt; "\"" &lt;&lt; endl; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3085 Trac 1.4.3 Hartmut Kaiser Mon, 01 Jun 2009 14:39:01 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3085#comment:1 https://svn.boost.org/trac10/ticket/3085#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This has been fixed in rev. 53536 </p> Ticket