Opened 13 years ago

Closed 13 years ago

#3085 closed Bugs (fixed)

Fixed-size buffers and strncpy

Reported by: olafvdspek@… Owned by: Joel de Guzman
Milestone: Boost 1.40.0 Component: spirit
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:

Description

Fixed-size buffers and strncpy really don't belong in an example of a Boost lib... ;)

boost_1_39_0\libs\spirit\classic\example\fundamental\comments.cpp:

void actor_cpp (const char *pfirst, const char *plast)
{
    cout << "Parsing C++-comment" <<endl;
    cout << "Matched (" << plast-pfirst << ") characters: ";

    char cbbuffer[128];

    strncpy(cbbuffer, pfirst, plast-pfirst);
    cbbuffer[plast-pfirst] = '\0';

    cout << "\"" << cbbuffer << "\"" << endl;
}

Change History (1)

comment:1 by Hartmut Kaiser, 13 years ago

Resolution: fixed
Status: newclosed

This has been fixed in rev. 53536

Note: See TracTickets for help on using tickets.