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