diff --git a/xwayland/launcher.c b/xwayland/launcher.c index 15443cd1..a83784c6 100644 --- a/xwayland/launcher.c +++ b/xwayland/launcher.c @@ -165,8 +165,9 @@ create_lockfile(int display, char *lockfile, size_t lsize) return -1; } + errno = 0; other = strtol(pid, &end, 10); - if (end != pid + 10) { + if (errno != 0 || end == pid || *end != '\0') { weston_log("can't parse lock file %s\n", lockfile); close(fd);