From 5837e13eddfcb66aa7f76f7475a5a389ecf0b522 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 11 Nov 2019 19:18:08 +0000
Subject: [PATCH] wrap: Fix logic for whether Steam Runtime is passed through

If opt_runtime is NULL, it makes no sense to look at what happens if it
is dereferenced. The intention here was to treat both NULL and the empty
string as no runtime.

Detected by clang scan-build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 src/wrap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wrap.c b/src/wrap.c
index 51c35e2d6..82e941e06 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -2469,7 +2469,7 @@ main (int argc,
 
   /* Put Steam Runtime environment variables back, if /usr is mounted
    * from the host. */
-  if (opt_runtime == NULL && opt_runtime[0] != '\0')
+  if (opt_runtime == NULL || opt_runtime[0] == '\0')
     {
       g_debug ("Making Steam Runtime available...");
 
-- 
GitLab