some code cleanup

This commit is contained in:
Peter Hatina 2013-06-11 21:01:59 +02:00
parent dbcd8b462e
commit 60900a9d91
2 changed files with 3 additions and 3 deletions

View File

@ -671,10 +671,10 @@ bool SMTPFileSystem::removeDir(const std::string &dirname)
std::string path;
dir = ::opendir(dirname.c_str());
if (dir == nullptr)
if (!dir)
return false;
while ((entry = ::readdir(dir)) != nullptr) {
while ((entry = ::readdir(dir))) {
if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) {
path = dirname + "/" + entry->d_name;
if (entry->d_type == DT_DIR)

View File

@ -87,7 +87,7 @@ bool MTPDevice::connect(int dev_no)
m_device = LIBMTP_Open_Raw_Device_Uncached(&raw_devices[dev_no]);
free(static_cast<void*>(raw_devices));
if (m_device == nullptr)
if (!m_device)
return false;
if (!enumStorages())