summaryrefslogtreecommitdiffhomepage
path: root/gui/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-19 15:37:55 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-20 09:35:28 +0200
commitae021e042ff106536388b9b80994421861e5e378 (patch)
tree855a7cd9e39e30d8f0f7fda764f03faa6be601a4 /gui/main.cpp
parent3a4abf2f46aa9c708e59d65713c347af645d45f5 (diff)
main: fix redundant null check
Diffstat (limited to 'gui/main.cpp')
-rw-r--r--gui/main.cpp14
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;
}