Skip to content

Commit

Permalink
Add comment about testing null terminated string
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusgo committed May 18, 2024
1 parent 43af161 commit bab066b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ impl Parser {
#(#ext_set_inits)*
bytes => {
if let Ok(name) = std::str::from_utf8(bytes) {
// This is probably always true but we check just to be sure.
if bytes.last() == Some(&0) {
out.other.push(name[0..(bytes.len() - 1)].into());
} else {
Expand Down

0 comments on commit bab066b

Please sign in to comment.