From fd5e7f62538d727653a50178dbd578bb33ac0ab6 Mon Sep 17 00:00:00 2001 From: daimiao chen Date: Thu, 5 Mar 2026 16:56:03 -0500 Subject: [PATCH] Using LFS_ASSERT instead of an runtime check. Remove NULL check from condition and assert callback is valid. --- lfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index fce9d3bf..ecedcd8f 100644 --- a/lfs.c +++ b/lfs.c @@ -1290,7 +1290,8 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs, } // found a match for our fetcher? - if ((fmask & tag) == (fmask & ftag) && (cb != NULL)) { + if ((fmask & tag) == (fmask & ftag)) { + LFS_ASSERT(cb != NULL); int res = cb(data, tag, &(struct lfs_diskoff){ dir->pair[0], off+sizeof(tag)}); if (res < 0) {