From 7ceda4f7d2916c0123aacea8005fc39cd8c04d02 Mon Sep 17 00:00:00 2001 From: sin Date: Thu, 26 Nov 2015 13:42:41 +0000 Subject: [PATCH] Declare var at top of block --- noice.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/noice.c b/noice.c index 8b278458..54a9455b 100644 --- a/noice.c +++ b/noice.c @@ -198,12 +198,12 @@ spawn(const char *file, const char *arg, const char *dir) char * xgetenv(char *name, char *fallback) { + char *value; + if (name == NULL) return fallback; - char *value = getenv(name); - if (value) - return value; - return fallback; + value = getenv(name); + return value ? value : fallback; } char *