summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/fileio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c
index 1f4c40c8fdb..0e19fc0f1ae 100644
--- a/usr.bin/mg/fileio.c
+++ b/usr.bin/mg/fileio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fileio.c,v 1.82 2008/09/15 16:11:35 kjell Exp $ */
+/* $OpenBSD: fileio.c,v 1.83 2011/01/21 18:58:55 kjell Exp $ */
/* This file is in the public domain. */
@@ -529,10 +529,8 @@ make_file_list(char *buf)
while ((dent = readdir(dirp)) != NULL) {
int isdir;
-
- if (dent->d_namlen < len || memcmp(cp, dent->d_name, len) != 0)
+ if (strncmp(cp, dent->d_name, len) != 0)
continue;
-
isdir = 0;
if (dent->d_type == DT_DIR) {
isdir = 1;