Skip to content

String str = "" not null terminated #2083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cbuttner opened this issue Apr 14, 2025 · 1 comment
Open

String str = "" not null terminated #2083

cbuttner opened this issue Apr 14, 2025 · 1 comment
Assignees
Labels
Accepted Accepted Request Enhancement Request New feature or request Implemented Needs Verification Check if this issue is resolved
Milestone

Comments

@cbuttner
Copy link
Contributor

char* c = "";
assert(c[0] == 0) ; // Good

String str1 = "a";
assert(str1.ptr[str1.len] == 0); // Good

String str2 = "";
assert(str2.ptr[0] == 0); // ERROR: 'Out of bounds memory access.'

This looks like an edge case, since you wouldn't expect

String str;
assert(str.ptr[0] == 0);

to work, but when initialized with "" it should probably work.

@lerno lerno added Bug Something isn't working Enhancement Request New feature or request and removed Bug Something isn't working labels Apr 16, 2025
@lerno lerno self-assigned this Apr 16, 2025
@lerno lerno added the Accepted Accepted Request label Apr 16, 2025
@lerno lerno added this to the 0.7.1 milestone Apr 16, 2025
@lerno lerno added the Implemented Needs Verification Check if this issue is resolved label Apr 16, 2025
@lerno
Copy link
Collaborator

lerno commented Apr 16, 2025

This is implemented now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted Request Enhancement Request New feature or request Implemented Needs Verification Check if this issue is resolved
Projects
None yet
Development

No branches or pull requests

2 participants