summaryrefslogtreecommitdiff
path: root/python/indexfile.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-17 16:07:03 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-17 16:07:03 +0200
commitb34e27d4ebaf325df6d82fde17b28cf9a008dbfc (patch)
treeb46a775144473e2bf2fbea051e54096335f0e405 /python/indexfile.cc
parentb63d93492cba1ffd11454ab37e751ef6f938ff96 (diff)
downloadpython-apt-b34e27d4ebaf325df6d82fde17b28cf9a008dbfc.tar.gz
python: Use PyString_FromFormat instead of snprintf.
Diffstat (limited to 'python/indexfile.cc')
-rw-r--r--python/indexfile.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/python/indexfile.cc b/python/indexfile.cc
index 7bf646d0..74345ec9 100644
--- a/python/indexfile.cc
+++ b/python/indexfile.cc
@@ -58,16 +58,13 @@ static PyObject *PackageIndexFileGetIsTrusted(PyObject *Self,void*) {
static PyObject *PackageIndexFileRepr(PyObject *Self)
{
pkgIndexFile *File = GetCpp<pkgIndexFile*>(Self);
-
- char S[1024];
- snprintf(S,sizeof(S),"<pkIndexFile object: "
+ return PyString_FromFormat("<pkIndexFile object: "
"Label:'%s' Describe='%s' Exists='%i' "
"HasPackages='%i' Size='%lu' "
"IsTrusted='%i' ArchiveURI='%s'>",
File->GetType()->Label, File->Describe().c_str(), File->Exists(),
File->HasPackages(), File->Size(),
File->IsTrusted(), File->ArchiveURI("").c_str());
- return PyString_FromString(S);
}
static PyGetSetDef PackageIndexFileGetSet[] = {