Skip to content

Commit

Permalink
fix: edge case where null terminator is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
heypoom committed Dec 19, 2023
1 parent 8484058 commit 097ea67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion canvas/src/blocks/value-view/components/ValueRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export const ValueRenderer = memo((props: ValueRendererProps) => {

case "String": {
// do not read after null terminator (\0)
const end = values.findIndex((x) => x === 0)
let end = values.findIndex((x) => x === 0)
if (end === -1) end = values.length

const text = values
.slice(0, end)
Expand Down

0 comments on commit 097ea67

Please sign in to comment.