From cd54dc84c4de9f78b2e0e1f019b2cb6c4fc099f4 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 22 Dec 2013 20:03:55 +0100 Subject: [PATCH] Fixed off-by-one error. --- src/x11_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11_window.c b/src/x11_window.c index e5bf436a..31c13a8b 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -789,7 +789,7 @@ static void processEvent(XEvent *event) { // Nautilus seems to add a \r at the end of the paths // remove it so paths can be directly used - _glfw.x11.xdnd.string = malloc(strlen(data)); + _glfw.x11.xdnd.string = malloc(strlen(data) + 1); char *to = _glfw.x11.xdnd.string; const char *from = data; const char *current = strchr(from, '\r');