summaryrefslogtreecommitdiff
path: root/python/apt_pkgmodule.cc
diff options
context:
space:
mode:
authorBen Finney <ben+debian@benfinney.id.au>2008-08-08 10:08:50 +1000
committerBen Finney <ben+debian@benfinney.id.au>2008-08-08 10:08:50 +1000
commit7b14352c54b7acbf2a68240fa960e188c6e8742a (patch)
tree48db4bb809d90743bdb7f6a6e3a429f83465d729 /python/apt_pkgmodule.cc
parent08fa9a44bc90b88f05cd8aa14d50892fadda9049 (diff)
parent44d1746f2dd6c055f340f9368d6411a9b6170150 (diff)
downloadpython-apt-7b14352c54b7acbf2a68240fa960e188c6e8742a.tar.gz
Fix whitespace in changes from 0.7.7.
Diffstat (limited to 'python/apt_pkgmodule.cc')
-rw-r--r--python/apt_pkgmodule.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index bbb21523..ab8ab33d 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -175,8 +175,11 @@ static PyObject *md5sum(PyObject *Self,PyObject *Args)
// Digest of a string.
if (PyString_Check(Obj) != 0)
{
+ char *s;
+ Py_ssize_t len;
MD5Summation Sum;
- Sum.Add(PyString_AsString(Obj));
+ PyString_AsStringAndSize(Obj, &s, &len);
+ Sum.Add((const unsigned char*)s, len);
return CppPyString(Sum.Result().Value());
}
@@ -212,8 +215,11 @@ static PyObject *sha1sum(PyObject *Self,PyObject *Args)
// Digest of a string.
if (PyString_Check(Obj) != 0)
{
+ char *s;
+ Py_ssize_t len;
SHA1Summation Sum;
- Sum.Add(PyString_AsString(Obj));
+ PyString_AsStringAndSize(Obj, &s, &len);
+ Sum.Add((const unsigned char*)s, len);
return CppPyString(Sum.Result().Value());
}
@@ -249,8 +255,11 @@ static PyObject *sha256sum(PyObject *Self,PyObject *Args)
// Digest of a string.
if (PyString_Check(Obj) != 0)
{
+ char *s;
+ Py_ssize_t len;
SHA256Summation Sum;
- Sum.Add(PyString_AsString(Obj));
+ PyString_AsStringAndSize(Obj, &s, &len);
+ Sum.Add((const unsigned char*)s, len);
return CppPyString(Sum.Result().Value());
}