[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [libqapt] src: Play it safe, and don't take the address of a temporary.
From:       Jonathan Thomas <echidnaman () kubuntu ! org>
Date:       2013-06-07 15:50:26
Message-ID: 20130607155026.1F898A605A () git ! kde ! org
[Download RAW message or body]

Git commit 2cd7e093485e039bec70defb8b10619e1e44e1b5 by Jonathan Thomas.
Committed on 07/06/2013 at 17:50.
Pushed by jmthomas into branch 'master'.

Play it safe, and don't take the address of a temporary.

M  +2    -1    src/backend.cpp

http://commits.kde.org/libqapt/2cd7e093485e039bec70defb8b10619e1e44e1b5

diff --git a/src/backend.cpp b/src/backend.cpp
index 7a9212b..e0f4312 100644
--- a/src/backend.cpp
+++ b/src/backend.cpp
@@ -576,7 +576,8 @@ PackageList Backend::search(const QString &searchString) const
       int top_percent = 0;
       for (Xapian::MSetIterator i = matches.begin(); i != matches.end(); ++i)
       {
-         Package* pkg = package(QLatin1String(i.get_document().get_data().c_str()));
+         std::string pkgName = i.get_document().get_data();
+         Package* pkg = package(QLatin1String(pkgName.c_str()));
          // Filter out results that apt doesn't know
          if (!pkg)
             continue;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic