From b95f06f9e9e726f73054a53c49b9ed6871d23507 Mon Sep 17 00:00:00 2001 From: rosenrost <52100845+rosenrost@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:38:47 +0100 Subject: [PATCH] Fix uninitialized return value of closedir() closedir() returned the never assigned local variable r, so callers checking for success got a random result. Return 0. --- sources/closedir.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/closedir.c b/sources/closedir.c index e551281..6e42169 100644 --- a/sources/closedir.c +++ b/sources/closedir.c @@ -24,8 +24,6 @@ int closedir(DIR *dirp) { - long r; - /* The GNU libc closedir returns gracefully if a NULL pointer is passed. We follow here. */ if (dirp == NULL) @@ -36,5 +34,5 @@ int closedir(DIR *dirp) free(dirp->dirname); free(dirp); - return r; + return 0; }