2 ms·
Ok, memcpy(dst, src, strlen(src)) it is then!
by commandlinefan 6y ago
Ok, memcpy(dst, src, strlen(src)) it is then!
- yetihehe 6y agoYay for errors, it should be memcpy(dst, src, strlen(src)+1). Strlen doesn't count last 0. If your dst is not zeroed already you will have unterminated string.
- commandlinefan 6y agoShould have let me use strncpy then, shouldn't you? ; P