You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
2.0 KiB

--- a/clamonacc/misc/fts.c
+++ b/clamonacc/misc/fts.c
@@ -744,11 +744,11 @@ static FTSENTRY *
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
continue;
- if ((p = fts_alloc(sp, dp->d_name, _D_EXACT_NAMLEN(dp))) == NULL)
+ if ((p = fts_alloc(sp, dp->d_name, strlen(dp->d_name))) == NULL)
goto mem1;
- if (_D_EXACT_NAMLEN(dp) >= maxlen) { /* include space for NUL */
+ if (strlen(dp->d_name) >= maxlen) { /* include space for NUL */
oldaddr = sp->fts_path;
- if (fts_palloc(sp, _D_EXACT_NAMLEN(dp) + len + 1)) {
+ if (fts_palloc(sp, strlen(dp->d_name) + len + 1)) {
/*
* No more memory for path or structures. Save
* errno, free up the current structure and the
@@ -773,7 +773,7 @@ static FTSENTRY *
maxlen = sp->fts_pathlen - len;
}
- if (len + _D_EXACT_NAMLEN(dp) >= USHRT_MAX) {
+ if (len + strlen(dp->d_name) >= USHRT_MAX) {
/*
* In an FTSENT, fts_pathlen is a u_short so it is
* possible to wraparound here. If we do, free up
@@ -790,7 +790,7 @@ static FTSENTRY *
}
p->fts_level = level;
p->fts_parent = sp->fts_cur;
- p->fts_pathlen = len + _D_EXACT_NAMLEN(dp);
+ p->fts_pathlen = len + strlen(dp->d_name);
#if defined FTS_WHITEOUT && 0
if (dp->d_type == DT_WHT)
--- a/clamonacc/misc/priv_fts.h
+++ b/clamonacc/misc/priv_fts.h
@@ -207,14 +207,18 @@ typedef struct _ftsent64 {
} FTSENT64;
#endif
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
FTSENT *_priv_fts_children(FTS *, int);
int _priv_fts_close(FTS *);
FTS *_priv_fts_open(char *const *, int,
int (*)(const FTSENT **, const FTSENT **));
FTSENT *_priv_fts_read(FTS *);
-int _priv_fts_set(FTS *, FTSENT *, int) __THROW;
-__END_DECLS
+int _priv_fts_set(FTS *, FTSENT *, int) __attribute__ ((__nothrow__));
+#ifdef __cplusplus
+}
+#endif
#endif /* fts.h */
#endif