diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2016-08-03 17:40:52 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2016-08-06 18:19:22 -0700 |
commit | 25a2bdd814ef70df3d2c6cdd4098644a34406510 (patch) | |
tree | 41eb2ba35e4a39ba7cb84c6e38374c7cc66da668 /xwayland | |
parent | 82b9f2baec2aabe659a7470cbdd51331bcd34906 (diff) | |
download | weston-25a2bdd814ef70df3d2c6cdd4098644a34406510.tar.gz |
Switch to use safe_strtoint instead of strtol
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/launcher.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xwayland/launcher.c b/xwayland/launcher.c index a83784c6..89723198 100644 --- a/xwayland/launcher.c +++ b/xwayland/launcher.c @@ -39,6 +39,7 @@ #include "xwayland.h" #include "xwayland-api.h" #include "shared/helpers.h" +#include "shared/string-helpers.h" #include "compositor/weston.h" static int @@ -147,7 +148,7 @@ bind_to_unix_socket(int display) static int create_lockfile(int display, char *lockfile, size_t lsize) { - char pid[16], *end; + char pid[16]; int fd, size; pid_t other; @@ -165,9 +166,7 @@ create_lockfile(int display, char *lockfile, size_t lsize) return -1; } - errno = 0; - other = strtol(pid, &end, 10); - if (errno != 0 || end == pid || *end != '\0') { + if (!safe_strtoint(pid, &other)) { weston_log("can't parse lock file %s\n", lockfile); close(fd); |