LalSalaamComrade@lemmy.ml to General Programming Discussion@lemmy.mlEnglish · 27 days agoAre there better alternatives to null-terminated strings?message-squaremessage-square14fedilinkarrow-up111
arrow-up111message-squareAre there better alternatives to null-terminated strings?LalSalaamComrade@lemmy.ml to General Programming Discussion@lemmy.mlEnglish · 27 days agomessage-square14fedilink
minus-squareLalSalaamComrade@lemmy.mlOPlinkfedilinkEnglisharrow-up3·27 days agoBut wouldn’t this be potentially unsafe? What programming language has this type of implementation, by the way?
minus-squareSubArcticTundra@lemmy.mllinkfedilinkarrow-up4·edit-227 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