noice

small file browser
git clone git://git.2f30.org/noice.git
Log | Files | Refs | README | LICENSE

commit 61cd0f8041e36757f4a02aa8894309412e35ccff
parent bc2d9e7c11f010e3f2c8ccf6d9a082aafc1a98b8
Author: sin <sin@2f30.org>
Date:   Fri Oct 10 10:12:01 +0100

Only closedir when dirp is valid

Diffstat:
noice.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/noice.c b/noice.c @@ -552,9 +552,11 @@ out: free(dents[i].name); free(dents); - r = closedir(dirp); - if (r == -1) - printerr(1, "closedir"); + if (dirp != NULL) { + r = closedir(dirp); + if (r == -1) + printerr(1, "closedir"); + } goto begin; }