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

  1. --- a/clamonacc/misc/fts.c
  2. +++ b/clamonacc/misc/fts.c
  3. @@ -744,11 +744,11 @@ static FTSENTRY *
  4. if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
  5. continue;
  6. - if ((p = fts_alloc(sp, dp->d_name, _D_EXACT_NAMLEN(dp))) == NULL)
  7. + if ((p = fts_alloc(sp, dp->d_name, strlen(dp->d_name))) == NULL)
  8. goto mem1;
  9. - if (_D_EXACT_NAMLEN(dp) >= maxlen) { /* include space for NUL */
  10. + if (strlen(dp->d_name) >= maxlen) { /* include space for NUL */
  11. oldaddr = sp->fts_path;
  12. - if (fts_palloc(sp, _D_EXACT_NAMLEN(dp) + len + 1)) {
  13. + if (fts_palloc(sp, strlen(dp->d_name) + len + 1)) {
  14. /*
  15. * No more memory for path or structures. Save
  16. * errno, free up the current structure and the
  17. @@ -773,7 +773,7 @@ static FTSENTRY *
  18. maxlen = sp->fts_pathlen - len;
  19. }
  20. - if (len + _D_EXACT_NAMLEN(dp) >= USHRT_MAX) {
  21. + if (len + strlen(dp->d_name) >= USHRT_MAX) {
  22. /*
  23. * In an FTSENT, fts_pathlen is a u_short so it is
  24. * possible to wraparound here. If we do, free up
  25. @@ -790,7 +790,7 @@ static FTSENTRY *
  26. }
  27. p->fts_level = level;
  28. p->fts_parent = sp->fts_cur;
  29. - p->fts_pathlen = len + _D_EXACT_NAMLEN(dp);
  30. + p->fts_pathlen = len + strlen(dp->d_name);
  31. #if defined FTS_WHITEOUT && 0
  32. if (dp->d_type == DT_WHT)
  33. --- a/clamonacc/misc/priv_fts.h
  34. +++ b/clamonacc/misc/priv_fts.h
  35. @@ -207,14 +207,18 @@ typedef struct _ftsent64 {
  36. } FTSENT64;
  37. #endif
  38. -__BEGIN_DECLS
  39. +#ifdef __cplusplus
  40. +extern "C" {
  41. +#endif
  42. FTSENT *_priv_fts_children(FTS *, int);
  43. int _priv_fts_close(FTS *);
  44. FTS *_priv_fts_open(char *const *, int,
  45. int (*)(const FTSENT **, const FTSENT **));
  46. FTSENT *_priv_fts_read(FTS *);
  47. -int _priv_fts_set(FTS *, FTSENT *, int) __THROW;
  48. -__END_DECLS
  49. +int _priv_fts_set(FTS *, FTSENT *, int) __attribute__ ((__nothrow__));
  50. +#ifdef __cplusplus
  51. +}
  52. +#endif
  53. #endif /* fts.h */
  54. #endif