fromStringzN
fn
string fromStringzN(const(char) * cstr, size_t maxLen) @trusted pure nothrowConverts a null-terminated C string to a D string with known maximum length.
This is safer when the string might not be properly null-terminated within the expected buffer size.
Parameters
cstr | Pointer to the C string |
maxLen | Maximum number of characters to read |
Returns
A D string copy of the C string