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/Properties.cpp | |
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/Properties.cpp')
-rw-r--r-- | py/modules/IcePy/Properties.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/py/modules/IcePy/Properties.cpp b/py/modules/IcePy/Properties.cpp index 808a9997b9d..44c2bffcd90 100644 --- a/py/modules/IcePy/Properties.cpp +++ b/py/modules/IcePy/Properties.cpp @@ -163,7 +163,7 @@ propertiesStr(PropertiesObject* self) str.append(p->first + "=" + p->second); } - return PyString_FromString(const_cast<char*>(str.c_str())); + return createString(str); } #ifdef WIN32 @@ -190,7 +190,7 @@ propertiesGetProperty(PropertiesObject* self, PyObject* args) return 0; } - return PyString_FromString(const_cast<char*>(value.c_str())); + return createString(value); } #ifdef WIN32 @@ -218,7 +218,7 @@ propertiesGetPropertyWithDefault(PropertiesObject* self, PyObject* args) return 0; } - return PyString_FromString(const_cast<char*>(value.c_str())); + return createString(value); } #ifdef WIN32 @@ -388,8 +388,8 @@ propertiesGetPropertiesForPrefix(PropertiesObject* self, PyObject* args) { for(Ice::PropertyDict::iterator p = dict.begin(); p != dict.end(); ++p) { - PyObjectHandle key = PyString_FromString(const_cast<char*>(p->first.c_str())); - PyObjectHandle val = PyString_FromString(const_cast<char*>(p->second.c_str())); + PyObjectHandle key = createString(p->first); + PyObjectHandle val = createString(p->second); if(!val.get() || PyDict_SetItem(result.get(), key.get(), val.get()) < 0) { return 0; |