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/acquire.cc | |
| parent | b63d93492cba1ffd11454ab37e751ef6f938ff96 (diff) | |
| download | python-apt-b34e27d4ebaf325df6d82fde17b28cf9a008dbfc.tar.gz | |
python: Use PyString_FromFormat instead of snprintf.
Diffstat (limited to 'python/acquire.cc')
| -rw-r--r-- | python/acquire.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/python/acquire.cc b/python/acquire.cc index 05429d1b..50bdc949 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -287,8 +287,8 @@ static PyObject *AcquireItemRepr(PyObject *Self) pkgAcquire::Item *Itm = acquireitem_tocpp(Self); if (Itm == 0) return 0; - char S[300]; - snprintf(S,sizeof(S),"<%s object: " + + return PyString_FromFormat("<%s object: " "Status: %i Complete: %i Local: %i IsTrusted: %i " "FileSize: %lu DestFile:'%s' " "DescURI: '%s' ID:%lu ErrorText: '%s'>", @@ -296,7 +296,6 @@ static PyObject *AcquireItemRepr(PyObject *Self) Itm->Status, Itm->Complete, Itm->Local, Itm->IsTrusted(), Itm->FileSize, Itm->DestFile.c_str(), Itm->DescURI().c_str(), Itm->ID,Itm->ErrorText.c_str()); - return PyString_FromString(S); } static void AcquireItemDealloc(PyObject *self) { |
