aboutsummaryrefslogtreecommitdiffstats
path: root/sap
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2011-06-21 10:34:05 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2011-06-28 10:51:15 +0300
commitd70388cda50c21563d1462911d45513db9d41e3c (patch)
tree82fe23b1ebaa01c386f7388997e12d666686d318 /sap
parent9edfc88f77cf83204e0a9cbdc407a14616a56f15 (diff)
downloadbluez-d70388cda50c21563d1462911d45513db9d41e3c.tar.gz
bluez-d70388cda50c21563d1462911d45513db9d41e3c.tar.xz
bluez-d70388cda50c21563d1462911d45513db9d41e3c.zip
Fix SAP message padding macro
With this patch it is not possible to have incorrect padding equal to 4.
Diffstat (limited to 'sap')
-rw-r--r--sap/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sap/server.c b/sap/server.c
index 011faa6e..c55aa6e4 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