aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--s2u.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/s2u.c b/s2u.c
index b3904f5..23c2a72 100644
--- a/s2u.c
+++ b/s2u.c
@@ -242,8 +242,11 @@ main (int argc, char *argv[])
die("unable to read X11 cookie");
} else {
close(in);
-
+
idx = rindex(result, ' ');
+ if (idx == NULL) {
+ die ("unable to read X11 cookie");
+ }
cookie = g_strdup(idx+1);
cookie[strlen(cookie) - 1] = '\0';
if (opt_debug) {