|
|
|
|
|
by masklinn
1061 days ago
|
|
That’s because strncpy does not return a nul-terminated (“C”) strings, but a fixed-size nul-padded strings. That, as it turns out, is the case of most (but not all) strn* functions. Of course strncpy adds the injury that it’s specified to alllow nul-terminated inputs (it stops at the first nul byte, before filling the target buffer with nuls). |
|