diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-17 16:07:03 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-17 16:07:03 +0200 |
| commit | b34e27d4ebaf325df6d82fde17b28cf9a008dbfc (patch) | |
| tree | b46a775144473e2bf2fbea051e54096335f0e405 /python/indexfile.cc | |
| parent | b63d93492cba1ffd11454ab37e751ef6f938ff96 (diff) | |
| download | python-apt-b34e27d4ebaf325df6d82fde17b28cf9a008dbfc.tar.gz | |
python: Use PyString_FromFormat instead of snprintf.
Diffstat (limited to 'python/indexfile.cc')
| -rw-r--r-- | python/indexfile.cc | 5 |
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[] = { |
