sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit e255527ad22334a275e385cd10bf5e6ed0a697a7
parent 351ea92e868c3ff1803f4023ea3021eebbb831ce
Author: Quentin Rameau <quinq@fifth.space>
Date:   Thu Feb 18 15:16:25 +0100

ls: check for the index size before using it in visit()

Thanks to k0ga for noticing it!

Diffstat:
ls.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ls.c b/ls.c @@ -311,7 +311,7 @@ visit(const struct entry *ent) dev = ent->dev; ino = S_ISLNK(ent->mode) ? ent->tino : ent->ino; - for (i = 0; tree[i].ino && i < PATH_MAX; ++i) { + for (i = 0; i < PATH_MAX && tree[i].ino; ++i) { if (ino == tree[i].ino && dev == tree[i].dev) return -1; }