aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/catman/catman.c10
-rw-r--r--usr.bin/makewhatis/makewhatis.c4
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/catman/catman.c b/usr.bin/catman/catman.c
index ba3ad248a2c2..c17a091593cb 100644
--- a/usr.bin/catman/catman.c
+++ b/usr.bin/catman/catman.c
@@ -589,9 +589,15 @@ process_section(char *mandir, char *section)
}
static int
-select_sections(struct dirent *entry)
+select_sections(const struct dirent *entry)
{
- return directory_type(entry->d_name) == MAN_SECTION_DIR;
+ char *name;
+ int ret;
+
+ name = strdup(entry->d_name);
+ ret = directory_type(name) == MAN_SECTION_DIR;
+ free(name);
+ return (ret);
}
/*
diff --git a/usr.bin/makewhatis/makewhatis.c b/usr.bin/makewhatis/makewhatis.c
index 6b2dce4e5950..f2ae3709d6dd 100644
--- a/usr.bin/makewhatis/makewhatis.c
+++ b/usr.bin/makewhatis/makewhatis.c
@@ -879,9 +879,9 @@ process_section(char *section_dir)
* Returns whether the directory entry is a man page section.
*/
static int
-select_sections(struct dirent *entry)
+select_sections(const struct dirent *entry)
{
- char *p = &entry->d_name[3];
+ const char *p = &entry->d_name[3];
if (strncmp(entry->d_name, "man", 3) != 0)
return 0;