From ae021e042ff106536388b9b80994421861e5e378 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 19 Apr 2017 15:37:55 +0200 Subject: main: fix redundant null check --- gui/main.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'gui/main.cpp') 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 ? "" : ptr) - << (ptr != nullptr && ptr[0] == '\0') - << (env_path[0] == '\0'); + qDebug() << "bad path element" + << (ptr == nullptr ? "" : ptr); ok = false; break; } -- cgit v1.2.3