From 5ee4931fb60e965cff48fdc182c161807ce451fc Mon Sep 17 00:00:00 2001 From: erorcun Date: Tue, 16 Feb 2021 18:26:44 +0300 Subject: [PATCH] Fix FindClose->closedir --- src/skel/crossplatform.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index e5f4c7ba..710a7702 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -132,7 +132,12 @@ void GetLocalTime_CP(SYSTEMTIME* out); typedef void* HANDLE; #define INVALID_HANDLE_VALUE NULL -#define FindClose(h) closedir((DIR*)h) +#define FindClose(h) \ + do { \ + if (h != nil) \ + closedir((DIR*)h); \ + } while(0) + #define LOCALE_USER_DEFAULT 0 #define DATE_SHORTDATE 0