#738: A character string cannot be taken out of the variable made by
Pointer.new('c').
----------------------------------+-----------------------------------------
Reporter: watson1...@… | Owner: lsansone...@…
Type: defect | Status: closed
Priority: blocker | Milestone:
Component: MacRuby | Resolution: invalid
Keywords: |
----------------------------------+-----------------------------------------
Changes (by lsansone...@…):
* status: new => closed
* resolution: => invalid
Comment:
You're creating a Pointer of only one character here, but asking
JSStringGetUTF8CString() to fill it up with more space. You're lucky that
it's not crashing :) You probably want Pointer.new('c', size) instead.
Also, buffer[0] will return you the first character, not the whole string.
Let us know if you still have an issue.
--
Ticket URL: <http://www.macruby.org/trac/ticket/738#comment:1>
MacRuby <http://macruby.org/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel