|
|
Message-ID: <20261118125553.9133-7-ilt@envs.net>
Date: Wed, 18 Nov 2026 15:49:48 +0300
From: illiliti <ilt@...s.net>
To: musl@...ts.openwall.com
Cc: illiliti <ilt@...s.net>
Subject: [PATCH v1 06/18] fts: drop _DIAGASSERT
---
src/misc/fts.c | 31 -------------------------------
1 file changed, 31 deletions(-)
diff --git a/src/misc/fts.c b/src/misc/fts.c
index e2790f71..1fe66231 100644
--- a/src/misc/fts.c
+++ b/src/misc/fts.c
@@ -110,8 +110,6 @@ fts_open(char * const *argv, int options,
FTSENT *parent, *tmp = NULL; /* pacify gcc */
size_t len;
- _DIAGASSERT(argv != NULL);
-
/* Options check. */
if (options & ~FTS_OPTIONMASK) {
errno = EINVAL;
@@ -222,9 +220,6 @@ fts_load(FTS *sp, FTSENT *p)
size_t len;
char *cp;
- _DIAGASSERT(sp != NULL);
- _DIAGASSERT(p != NULL);
-
/*
* Load the stream structure for the next traversal. Since we don't
* actually enter the directory until after the preorder visit, set
@@ -249,8 +244,6 @@ fts_close(FTS *sp)
FTSENT *freep, *p;
int saved_errno = 0;
- _DIAGASSERT(sp != NULL);
-
/*
* This still works if we haven't read anything -- the dummy structure
* points to the root list, so we step through to the end of the root
@@ -324,8 +317,6 @@ fts_read(FTS *sp)
char *t;
int saved_errno;
- _DIAGASSERT(sp != NULL);
-
/* If finished or unrecoverable error, return NULL. */
if (sp->fts_cur == NULL || ISSET(FTS_STOP))
return (NULL);
@@ -526,9 +517,6 @@ int
fts_set(FTS *sp, FTSENT *p, int instr)
{
- _DIAGASSERT(sp != NULL);
- _DIAGASSERT(p != NULL);
-
if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
errno = EINVAL;
@@ -544,8 +532,6 @@ fts_children(FTS *sp, int instr)
FTSENT *p;
int fd;
- _DIAGASSERT(sp != NULL);
-
if (instr && instr != FTS_NAMEONLY) {
errno = EINVAL;
return (NULL);
@@ -639,8 +625,6 @@ fts_build(FTS *sp, int type)
#endif
char *cp = NULL; /* pacify gcc */
- _DIAGASSERT(sp != NULL);
-
/* Set current node pointer. */
cur = sp->fts_cur;
@@ -911,9 +895,6 @@ fts_stat(FTS *sp, FTSENT *p, int follow)
__fts_stat_t *sbp, sb;
int saved_errno;
- _DIAGASSERT(sp != NULL);
- _DIAGASSERT(p != NULL);
-
/* If user needs stat info, stat buffer already allocated. */
sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
@@ -990,9 +971,6 @@ fts_sort(FTS *sp, FTSENT *head, size_t nitems)
{
FTSENT **ap, *p;
- _DIAGASSERT(sp != NULL);
- _DIAGASSERT(head != NULL);
-
/*
* Construct an array of pointers to the structures and call qsort(3).
* Reassemble the array in the order returned by qsort. If unable to
@@ -1025,9 +1003,6 @@ fts_alloc(FTS *sp, const char *name, size_t namelen)
size_t len;
#endif
- _DIAGASSERT(sp != NULL);
- _DIAGASSERT(name != NULL);
-
#if defined(FTS_ALLOC_ALIGNED)
/*
* The file name is a variable length array and no stat structure is
@@ -1128,8 +1103,6 @@ fts_palloc(FTS *sp, size_t size)
{
char *new;
- _DIAGASSERT(sp != NULL);
-
#ifdef __FTS_COMPAT_LENGTH
/* Protect against fts_pathlen overflow. */
if (size > USHRT_MAX + 1) {
@@ -1156,8 +1129,6 @@ fts_padjust(FTS *sp, FTSENT *head)
FTSENT *p;
char *addr;
- _DIAGASSERT(sp != NULL);
-
#define ADJUST(p) do { \
if ((p)->fts_accpath != (p)->fts_name) \
(p)->fts_accpath = \
@@ -1183,8 +1154,6 @@ fts_maxarglen(char * const *argv)
{
size_t len, max;
- _DIAGASSERT(argv != NULL);
-
for (max = 0; *argv; ++argv)
if ((len = strlen(*argv)) > max)
max = len;
--
2.55.0
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.