From d70388cda50c21563d1462911d45513db9d41e3c Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Tue, 21 Jun 2011 10:34:05 +0200 Subject: [PATCH] Fix SAP message padding macro With this patch it is not possible to have incorrect padding equal to 4. --- sap/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sap/server.c b/sap/server.c index 011faa6e9..c55aa6e40 100644 --- a/sap/server.c +++ b/sap/server.c @@ -49,7 +49,7 @@ #define SAP_UUID "0000112D-0000-1000-8000-00805F9B34FB" #define SAP_SERVER_CHANNEL 8 -#define PADDING4(x) (4 - (x & 0x03)) +#define PADDING4(x) ((4 - (x & 0x03)) & 0x03) #define PARAMETER_SIZE(x) (sizeof(struct sap_parameter) + x + PADDING4(x)) #define SAP_NO_REQ 0xFF