From f516213bf3b5906365e90db731bff310802d9938 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Sun, 16 Aug 2009 00:16:58 +0200 Subject: [PATCH] Check for argc==0 when calling wtokensplit() The WINGs-function wtokensplit does not set argv to NULL if no string has been split - instead argc is set to 0. You can only observe this issue if you compile Window Maker without any optimization: compile Window Maker with CFLAGS="" run Window Maker and save a session change session-file and replace a 'command xyz' line with 'command " "' restart Window Maker watch "Fatal error"-message Retrieved-from: http://paldium.homeunix.org/tobias/wmaker/ Submitted-by: Gilbert Ashley --- src/dock.c | 2 +- src/session.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dock.c b/src/dock.c index df173a84..dfda3022 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2977,7 +2977,7 @@ execCommand(WAppIcon *btn, char *command, WSavedState *state) wtokensplit(cmdline, &argv, &argc); - if (argv==NULL) { + if (!argc) { if (cmdline) wfree(cmdline); if (state) diff --git a/src/session.c b/src/session.c index 83cf97ef..1c801c81 100644 --- a/src/session.c +++ b/src/session.c @@ -381,7 +381,7 @@ execCommand(WScreen *scr, char *command, char *host) wtokensplit(command, &argv, &argc); - if (argv==NULL) { + if (!argc) { return 0; }