diff --git a/quark.c b/quark.c
index 3c80be1..49cef68 100644
--- a/quark.c
+++ b/quark.c
@@ -387,7 +387,7 @@ senddir(int fd, char *name, struct request *r)
/* entry line */
if (dprintf(fd, "
\n\t\t%s%s",
e[i]->d_name,
- (e[i]->d_type & DT_DIR ? "/" : ""),
+ (e[i]->d_type == DT_DIR) ? "/" : "",
e[i]->d_name,
filetype(e[i]->d_type)) < 0) {
s = S_REQUEST_TIMEOUT;