LalSalaamComrade to General Programming [email protected]English • 19 days agoAre there better alternatives to null-terminated strings?message-square14fedilinkarrow-up111arrow-down10
arrow-up111arrow-down1message-squareAre there better alternatives to null-terminated strings?LalSalaamComrade to General Programming [email protected]English • 19 days agomessage-square14fedilink
minus-squareLalSalaamComradeOPlinkfedilinkEnglish3•19 days agoBut wouldn’t this be potentially unsafe? What programming language has this type of implementation, by the way?
minus-square@[email protected]linkfedilink4•edit-219 days agoHmm I think I saw it in a C library Edit: Might have been this one https://github.com/msteinert/bstring Edit: actually seems it’s this one. Look at what happens to ystr_header_t https://github.com/Amaury/Ylib/blob/master/src/ystr.c
But wouldn’t this be potentially unsafe? What programming language has this type of implementation, by the way?
Hmm I think I saw it in a C library
Edit: Might have been this one https://github.com/msteinert/bstring
Edit: actually seems it’s this one. Look at what happens to ystr_header_t https://github.com/Amaury/Ylib/blob/master/src/ystr.c