diff options
author | Mark Spruiell <mes@zeroc.com> | 2008-01-31 06:41:01 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2008-01-31 06:41:01 -0800 |
commit | 2b9fbb15c8f5b5af154bdffaf334e4b75a601e90 (patch) | |
tree | a6a3a30cb56f7dc1a15ddb5bc009d3026f67802c /py/modules/IcePy/Util.h | |
parent | More ICE_HOME fixes (diff) | |
download | ice-2b9fbb15c8f5b5af154bdffaf334e4b75a601e90.tar.bz2 ice-2b9fbb15c8f5b5af154bdffaf334e4b75a601e90.tar.xz ice-2b9fbb15c8f5b5af154bdffaf334e4b75a601e90.zip |
bug 2412: python bug with embedded nulls in strings
Diffstat (limited to 'py/modules/IcePy/Util.h')
-rw-r--r-- | py/modules/IcePy/Util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/modules/IcePy/Util.h b/py/modules/IcePy/Util.h index 104a259277a..a9b084ecbee 100644 --- a/py/modules/IcePy/Util.h +++ b/py/modules/IcePy/Util.h @@ -47,6 +47,11 @@ inline PyObject* getTrue() return reinterpret_cast<PyObject*>(i); } +inline PyObject* createString(const std::string& str) +{ + return PyString_FromStringAndSize(str.c_str(), static_cast<Py_ssize_t>(str.size())); +} + // // Invokes Py_DECREF on a Python object. // |