From 448cbd472ef8154704e6ae2c0b88464b2bba54f4 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Wed, 17 Oct 2018 16:59:36 +0200 Subject: 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. --- video/out/x11_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'video/out') 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"); -- cgit v1.2.3