summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Util.h
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-01-31 06:41:01 -0800
committerMark Spruiell <mes@zeroc.com>2008-01-31 06:41:01 -0800
commit2b9fbb15c8f5b5af154bdffaf334e4b75a601e90 (patch)
treea6a3a30cb56f7dc1a15ddb5bc009d3026f67802c /py/modules/IcePy/Util.h
parentMore ICE_HOME fixes (diff)
downloadice-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.h5
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.
//