Skip to content

Commit

Permalink
fix(utils/string): properly set null terminator
Browse files Browse the repository at this point in the history
I'm stupid
  • Loading branch information
Curve committed Oct 23, 2024
1 parent 6a207a7 commit 13c3fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ char *bindings::alloc(const std::string &value)
char *const rtn = static_cast<char *>(saucer_memory_alloc(size + 1));

value.copy(rtn, size);
rtn[size + 1] = '\0';
rtn[size] = '\0';

return rtn;
}

0 comments on commit 13c3fa5

Please sign in to comment.