From 965a7ae9e0af3bc148a62a7c1c3b3ec1506fb885 Mon Sep 17 00:00:00 2001 From: Tsarevich Dmitry Date: Sun, 23 Feb 2020 19:46:18 +0300 Subject: [PATCH] [flow] Surround macro params to ensure expected results If parameters are not enclosed, evaluation order may be not the expected one. See https://www.viva64.com/en/w/v1003/print/ for details. --- src/rufus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rufus.h b/src/rufus.h index 98be9361..359baa1d 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -656,8 +656,8 @@ static __inline HMODULE GetLibraryHandle(char* szLibraryName) { if ((pf##proc == NULL) && (NT_SUCCESS(status))) status = STATUS_NOT_IMPLEMENTED; } while(0) /* Custom application errors */ -#define FAC(f) (f<<16) -#define APPERR(err) (APPLICATION_ERROR_MASK|err) +#define FAC(f) ((f)<<16) +#define APPERR(err) (APPLICATION_ERROR_MASK|(err)) #define ERROR_INCOMPATIBLE_FS 0x1201 #define ERROR_CANT_QUICK_FORMAT 0x1202 #define ERROR_INVALID_CLUSTER_SIZE 0x1203