4 ms·
Someone will likely be able to answer more specifically, but I seem to recall an old common operation was filling fixed width text fields; truncating a message
by dwattttt 4y ago
Someone will likely be able to answer more specifically, but I seem to recall an old common operation was filling fixed width text fields; truncating a message would make sense there (not ideal, but probably familiar).
- gdprrrr 4y agoExcept to properly implement that you'll need to deal with grapheme clusters.
- tialaramex 4y agoI expect the parent is thinking of why strncpy is the way it is, and the people who built that were glad if their terminal had both uppercase and lowercase letters, they didn't have Unicode, or grapheme clusters, their concern wasn't "will this string fit in this many pixels on my 24" flat panel?" but "Will this string fit in these 10 bytes where the filename needs to go in the directory data structure of the filesystem?".