summaryrefslogtreecommitdiffstats
path: root/wayland
diff options
context:
space:
mode:
authorLibravatar Nicolas Werner <Nicolas.Werner@hotmail.de>2015-12-15 22:56:48 +0100
committerLibravatar Nicolas Werner <Nicolas.Werner@hotmail.de>2015-12-15 22:56:48 +0100
commit8fae31e96cdad2cd772ff788f1a3bbc7823bfebe (patch)
tree5674fef2fe0ab8a0ff8779294ffb2be9479b2e9b /wayland
parentMerge pull request #333 from mikkeloscar/free-list (diff)
downloadsway-8fae31e96cdad2cd772ff788f1a3bbc7823bfebe.tar.gz
sway-8fae31e96cdad2cd772ff788f1a3bbc7823bfebe.tar.zst
sway-8fae31e96cdad2cd772ff788f1a3bbc7823bfebe.zip
fix segfault when doesn't have a trailing '/'
Diffstat (limited to 'wayland')
-rw-r--r--wayland/buffers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wayland/buffers.c b/wayland/buffers.c
index 1e5e5693..ba783b37 100644
--- a/wayland/buffers.c
+++ b/wayland/buffers.c
@@ -12,7 +12,7 @@
12#include "log.h" 12#include "log.h"
13 13
14static int create_pool_file(size_t size, char **name) { 14static int create_pool_file(size_t size, char **name) {
15 static const char template[] = "/sway-client-XXXXXX"; 15 static const char template[] = "sway-client-XXXXXX";
16 const char *path = getenv("XDG_RUNTIME_DIR"); 16 const char *path = getenv("XDG_RUNTIME_DIR");
17 if (!path) { 17 if (!path) {
18 return -1; 18 return -1;
@@ -23,7 +23,7 @@ static int create_pool_file(size_t size, char **name) {
23 *name = malloc( 23 *name = malloc(
24 strlen(template) + 24 strlen(template) +
25 strlen(path) + 25 strlen(path) +
26 (ts ? 1 : 0) + 1); 26 (ts ? 0 : 1) + 1);
27 sprintf(*name, "%s%s%s", path, ts ? "" : "/", template); 27 sprintf(*name, "%s%s%s", path, ts ? "" : "/", template);
28 28
29 int fd = mkstemp(*name); 29 int fd = mkstemp(*name);