summaryrefslogtreecommitdiff
path: root/lib/ftw.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-03-06 14:14:16 +0000
committerJim Meyering <jim@meyering.net>2003-03-06 14:14:16 +0000
commitb70ecc4de11cf61852b15d2e2e46073602706bd0 (patch)
tree3f88876563a92bfd52be5b8bab77b23d1a8a0c11 /lib/ftw.c
parentce8758e12c5a295a26c44f02ba8090cc89510839 (diff)
downloadcoreutils-b70ecc4de11cf61852b15d2e2e46073602706bd0.tar.xz
Fix a bug that causes du to dump core on 64-bit systems.
(ftw_startup): Declare `func' parameter to be of type NFTW_FUNC_T, not void* which may be smaller on 64-bit systems. Remove now-unnecessary cast. (FTW_NAME): Cast func argument to type `NFTW_FUNC_T'.
Diffstat (limited to 'lib/ftw.c')
-rw-r--r--lib/ftw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ftw.c b/lib/ftw.c
index 677e6ff76..2161b89b5 100644
--- a/lib/ftw.c
+++ b/lib/ftw.c
@@ -636,7 +636,7 @@ base_name (char const *name)
static int
internal_function
-ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
+ftw_startup (const char *dir, int is_nftw, NFTW_FUNC_T func, int descriptors,
int flags)
{
struct ftw_data data;
@@ -682,7 +682,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
every case the callback using the format of the `nftw' version
and get the correct result since the stack layout for a function
call in C allows this. */
- data.func = (NFTW_FUNC_T) func;
+ data.func = func;
/* Since we internally use the complete set of FTW_* values we need
to reduce the value range before calling a `ftw' callback. */
@@ -799,7 +799,7 @@ FTW_NAME (path, func, descriptors)
FTW_FUNC_T func;
int descriptors;
{
- return ftw_startup (path, 0, func, descriptors, 0);
+ return ftw_startup (path, 0, (NFTW_FUNC_T) func, descriptors, 0);
}
int