diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2015-12-15 22:56:48 +0100 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2015-12-15 22:56:48 +0100 |
| commit | 7466f4dbb592173865090fa9b4ef1bcae083a923 (patch) | |
| tree | 5674fef2fe0ab8a0ff8779294ffb2be9479b2e9b /wayland | |
| parent | fc3411a6a2df4ae4488771a0d709e650a7349ce9 (diff) | |
fix segfault when doesn't have a trailing '/'
Diffstat (limited to 'wayland')
| -rw-r--r-- | wayland/buffers.c | 4 |
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 @@ #include "log.h" static int create_pool_file(size_t size, char **name) { - static const char template[] = "/sway-client-XXXXXX"; + static const char template[] = "sway-client-XXXXXX"; const char *path = getenv("XDG_RUNTIME_DIR"); if (!path) { return -1; @@ -23,7 +23,7 @@ static int create_pool_file(size_t size, char **name) { *name = malloc( strlen(template) + strlen(path) + - (ts ? 1 : 0) + 1); + (ts ? 0 : 1) + 1); sprintf(*name, "%s%s%s", path, ts ? "" : "/", template); int fd = mkstemp(*name); |
