Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
clean: readlinkat return the size of the buffer without the terminal NULL
Baptiste Daroussin committed 2 months ago
commit 9049a042cbc493299f6afdee8b9715ad91f406ad
parent 002313b
1 file changed +1 -4
modified src/clean.c
@@ -233,10 +233,7 @@ recursive_analysis(int fd, struct pkgdb *db, const char *dir,
			if ((link_len = readlinkat(fd, ent->d_name, link_buf,
			    sizeof(link_buf))) == -1)
				continue;
-
			if (link_len > 0 )
-
				link_buf[link_len - 1] = '\0';
-
			else
-
				link_buf[0]='\0';
+
			link_buf[link_len] = '\0';
			name = link_buf;
		}