~jscott/which

fb5461b07bf1e0a4f645ca0b3f8e461fa2b86058 — John Scott 3 months ago 32b7cae
Initialize pathname_found.

clang-tidy pointed out that if the addition overflow
checks were to turn out true, the loop could stop and
reading pathname_found would be undefined.
1 files changed, 1 insertions(+), 1 deletions(-)

M which.c
M which.c => which.c +1 -1
@@ 66,7 66,7 @@ static void *find_program(void *progname) {
	/* It's not an absolute pathname; try prefixing the string
	 * with strings from PATH and see what sticks. */
	const size_t filenamelen = strlen(progname);
	bool pathname_found;
	bool pathname_found = false;
	char *pathname;
	assert(*list);
	for(char **directory = list; *directory; directory++) {