From 6b998b5ed066aeece1146fe245b35965319b3cbd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 May 2017 16:59:26 +0200 Subject: Cleaner code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 715ce4e..f6150f2 100644 --- a/src/util.c +++ b/src/util.c @@ -234,8 +234,8 @@ int xenopen(int status, const char *path, int flags, int mode, ...) { int fd; - if (!strncmp(path, "/dev/fd/", sizeof("/dev/fd/") - 1)) { - if (!toi(path + sizeof("/dev/fd/") - 1, 0, INT_MAX, &fd)) + if (!strncmp(path, "/dev/fd/", STRLEN("/dev/fd/"))) { + if (!toi(path + STRLEN("/dev/fd/"), 0, INT_MAX, &fd)) return fd; } else if (!strcmp(path, "/dev/stdin")) { return STDIN_FILENO; -- cgit v1.2.3-70-g09d2