diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-19 15:37:55 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-20 09:35:28 +0200 |
commit | ae021e042ff106536388b9b80994421861e5e378 (patch) | |
tree | 855a7cd9e39e30d8f0f7fda764f03faa6be601a4 /gui/main.cpp | |
parent | 3a4abf2f46aa9c708e59d65713c347af645d45f5 (diff) |
main: fix redundant null check
Diffstat (limited to 'gui/main.cpp')
-rw-r--r-- | gui/main.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gui/main.cpp b/gui/main.cpp index cf6951c2..80040732 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -73,17 +73,13 @@ void add_win32_path() for (const char* ptr : contents) { - if (ptr == nullptr) - continue; + if (ptr) + strcat_s(env_path, sizeof(env_path), ptr); - strcat_s(env_path, sizeof(env_path), ptr); - - if (ptr[0] == '\0' || env_path[0] == '\0') + if (!ptr || ptr[0] == '\0' || env_path[0] == '\0') { - qDebug() << "bad path element, debug info:" - << (ptr == nullptr ? "<null>" : ptr) - << (ptr != nullptr && ptr[0] == '\0') - << (env_path[0] == '\0'); + qDebug() << "bad path element" + << (ptr == nullptr ? "<null>" : ptr); ok = false; break; } |