2 ms·
That's your understanding now. Fine, but not evidence of what someone else thought about this some decades ago. (I don't use strncpy and don't defend its funct
by kzrdude 4y ago
That's your understanding now. Fine, but not evidence of what someone else thought about this some decades ago.
(I don't use strncpy and don't defend its functionality, just want to know what was intended when it was introduced.)
- kzrdude 4y agoI found an actual quote of a source which verifies the intention for fixed-length fields: https://softwareengineering.stackexchange.com/a/438090 https://softwareengineering.stackexchange.com/a/438090
- spc476 4y agoOn early Unix systems, the directory structure was a simple 16-byte record; 14 bytes for the name, and 2 bytes for the inode. [1] strncpy() was used to simply record the file name into this structure. [1] "UNIX Implementation" by Ken Thompson, _The Bell System Technical Journal_, July-August 1978, Vol 57, No 6, Part 2, pg 1942.