diff --git a/src/utils/scdaemon.cpp b/src/utils/scdaemon.cpp index 73440db07..e44a226ab 100644 --- a/src/utils/scdaemon.cpp +++ b/src/utils/scdaemon.cpp @@ -1,55 +1,54 @@ /* utils/scdaemon.cpp This file is part of libkleopatra SPDX-FileCopyrightText: 2021 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #include #include "scdaemon.h" #include "utils/assuan.h" #include "utils/hex.h" #include "utils/stringutils.h" #if __has_include() # include #endif #include #include "libkleo_debug.h" using namespace Kleo; using namespace GpgME; std::vector Kleo::SCDaemon::getReaders(Error &err) { std::vector result; auto c = Context::createForEngine(AssuanEngine, &err); if (err) { qCDebug(LIBKLEO_LOG) << "Creating context for Assuan engine failed:" << err; return result; } auto assuanContext = std::shared_ptr(c.release()); const std::string command = "SCD GETINFO reader_list"; - const auto readersData = Assuan::sendDataCommand(assuanContext, command.c_str(), err); + const auto readers = Assuan::sendDataCommand(assuanContext, command.c_str(), err); if (err) { return result; } - const auto readers = hexdecode(readersData); result = split(readers, '\n'); // remove empty entries; in particular, the last entry result.erase(std::remove_if(std::begin(result), std::end(result), std::mem_fn(&std::string::empty)), std::end(result)); return result; }