From e0ba689dba9037fa008d834373704045b2fc2f59 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sun, 17 Jan 2016 18:47:36 +0100 Subject: [PATCH] Copy filename from argv Fix #449 --- swaygrab/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swaygrab/main.c b/swaygrab/main.c index 403f7b38..82d623e7 100644 --- a/swaygrab/main.c +++ b/swaygrab/main.c @@ -229,7 +229,7 @@ int main(int argc, char **argv) { sway_abort("Invalid usage. See `man swaygrab` %d %d", argc, optind); } } else if (optind < argc) { - file = argv[optind]; + file = strdup(argv[optind]); } int socketfd = ipc_open_socket(socket_path);