aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-05-10 16:59:26 +0200
committerMattias Andrée <maandree@kth.se>2017-05-10 16:59:26 +0200
commit6b998b5ed066aeece1146fe245b35965319b3cbd (patch)
treec963b48fbefafcec89a4e4af238869a1cb51148e /src/util.c
parentblind-flip is optimal (diff)
downloadblind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.gz
blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.bz2
blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.xz
Cleaner code
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c4
1 files changed, 2 insertions, 2 deletions
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;