summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas F <ovdev@fratti.ch>2018-10-17 16:59:36 +0200
committersfan5 <sfan5@live.de>2018-10-19 22:57:49 +0200
commit448cbd472ef8154704e6ae2c0b88464b2bba54f4 (patch)
treed0b287340b9de68a14694ab7f55114c5356a3b94
parent104b51077451a3f9e259ca9aeff0c70ac1aa1d27 (diff)
downloadmpv-448cbd472ef8154704e6ae2c0b88464b2bba54f4.tar.bz2
mpv-448cbd472ef8154704e6ae2c0b88464b2bba54f4.tar.xz
x11_common: replace atoi with strtoul
Using strtol and strtoul is allegedly better practice, and I'm going for strtoul here because I'm pretty sure X11 displays cannot be in the negative.
-rw-r--r--video/out/x11_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 25325e760c..e448c786ae 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -588,7 +588,8 @@ int vo_x11_init(struct vo *vo)
dispName += 4;
else if (strncmp(dispName, "localhost:", 10) == 0)
dispName += 9;
- x11->display_is_local = dispName[0] == ':' && atoi(dispName + 1) < 10;
+ x11->display_is_local = dispName[0] == ':' &&
+ strtoul(dispName + 1, NULL, 10) < 10;
MP_VERBOSE(x11, "X11 running at %dx%d (\"%s\" => %s display)\n",
x11->ws_width, x11->ws_height, dispName,
x11->display_is_local ? "local" : "remote");