4 comments

[ 3.1 ms ] story [ 12.6 ms ] thread
Putting aside the fact that using sizeof is risky in itself, i'd argue the default form should be

    strncpy (buffer, "abcd", sizeof(buffer));
    assert (!buffer[sizeof(buffer) - 1]);