Fix for handling strings with zero bytes from Stephen Hutsal.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9387 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5dc2ce0c73
commit
4e9e588769
2 changed files with 5 additions and 1 deletions
|
|
@ -19,7 +19,8 @@ double SwigSvToNumber(SV* sv) {
|
|||
}
|
||||
std::string SwigSvToString(SV* sv) {
|
||||
STRLEN len;
|
||||
return SvPV(sv,len);
|
||||
char *ptr = SvPV(sv, len);
|
||||
return std::string(ptr, len);
|
||||
}
|
||||
void SwigSvFromString(SV* sv, const std::string& s) {
|
||||
sv_setpvn(sv,s.data(),s.size());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue