diff options
| author | bakkeby <[email protected]> | 2020-11-06 13:29:43 +0100 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-11-06 13:29:43 +0100 |
| commit | 558849940b6056b1d918ef12ce31e64763461a38 (patch) | |
| tree | ad4927f98c3d959992d05404e843a632865d34de /patch/ipc | |
| parent | 8b43316e9678dc69bf36be4e0f64fbe7231237d5 (diff) | |
| download | dwm-flexipatch-558849940b6056b1d918ef12ce31e64763461a38.tar.gz dwm-flexipatch-558849940b6056b1d918ef12ce31e64763461a38.zip | |
ipc patch: avoid segmentation fault running dwm-msg without any arguments
Diffstat (limited to 'patch/ipc')
| -rw-r--r-- | patch/ipc/dwm-msg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patch/ipc/dwm-msg.c b/patch/ipc/dwm-msg.c index f042b3d..089dc9f 100644 --- a/patch/ipc/dwm-msg.c +++ b/patch/ipc/dwm-msg.c @@ -499,12 +499,12 @@ main(int argc, char *argv[]) } int i = 1; - if (strcmp(argv[i], "--ignore-reply") == 0) { + if (i < argc && strcmp(argv[i], "--ignore-reply") == 0) { ignore_reply = 1; i++; } - // if (i >= argc) usage_error(prog_name, "Expected an argument, got none"); + if (i >= argc) usage_error(prog_name, "Expected an argument, got none"); if (!argc || strcmp(argv[i], "help") == 0) print_usage(prog_name); |
