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

Make sure that mrb_string_value_ptr() returns a null-terminated string. #2673

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@sdottaka
Contributor

sdottaka commented Dec 16, 2014

This fixes the following unexpected behavior.

$ mirb
> ENV["PATH"]
 => "C:\Program Files ....
> ENV["PATH************************"[0..3]]
 => nil
Make sure that mrb_string_value_ptr() returns a null-terminated string.
This fixes the following unexpected behavior.

~~~
$ mirb
> ENV["PATH"]
 => "C:\Program Files ....
> ENV["PATH************************"[0..3]]
 => nil
~~~
@matz

This comment has been minimized.

Show comment
Hide comment
@matz

matz Dec 16, 2014

Member

mrb_string_value_ptr() is a function to retrieve raw pointer. instead iij/mruby-env should use mrb_string_value_cstr(). I submitted an issue iij/mruby-env#9.

Member

matz commented Dec 16, 2014

mrb_string_value_ptr() is a function to retrieve raw pointer. instead iij/mruby-env should use mrb_string_value_cstr(). I submitted an issue iij/mruby-env#9.

@matz matz closed this Dec 16, 2014

@sdottaka

This comment has been minimized.

Show comment
Hide comment
@sdottaka

sdottaka Dec 16, 2014

Contributor

Thank you for your explanation.

Contributor

sdottaka commented Dec 16, 2014

Thank you for your explanation.

@sdottaka sdottaka deleted the sdottaka:fix-mrb_string_value_ptr branch Dec 16, 2014

sdottaka added a commit to sdottaka/mruby-win32ole that referenced this pull request Dec 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment