logoalt Hacker News

fsckboylast Friday at 11:05 PM1 replyview on HN

nooooo you don't understand. when the buffer is not full, the string will be zero terminated "in buffer" (which is how it works as is anyway). when the buffer is full, the "free count" at the end will do double duty, both as a zero count and a zero terminater


Replies

ranger_dangerlast Friday at 11:16 PM

But calling "normal C string functions" don't know about the "free count" byte, right? So it wouldn't be updated... unless I'm misunderstanding something.

show 2 replies