commit 916ab81c02da26234240b023b1e82700b50367dd
parent 87739618cac5efe3169368818e0ffd21c4e0a878
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 15 Dec 2015 17:11:36 -0500
Merge pull request #334 from MonokelPinguin/master
fix segfault when doesn't have a trailing '/'
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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);