fix missing parenthesis protection
authorStepan Vondrak <stepan.vondrak@slightlymadstudios.com>
Thu, 15 Oct 2015 13:05:54 +0000 (21:05 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 15 Oct 2015 13:05:54 +0000 (21:05 +0800)
lib/libwebsockets.h

index 6b5ee4c..7ab6dca 100644 (file)
@@ -1233,7 +1233,7 @@ libwebsocket_set_timeout(struct libwebsocket *wsi,
 #else
 #define _LWS_PAD_SIZE sizeof(void *)   // The pointer size on any unknown arch.
 #endif
-#define _LWS_PAD(n) (((n) % _LWS_PAD_SIZE) ? (n + (_LWS_PAD_SIZE - (n % _LWS_PAD_SIZE))) : (n))
+#define _LWS_PAD(n) (((n) % _LWS_PAD_SIZE) ? ((n) + (_LWS_PAD_SIZE - ((n) % _LWS_PAD_SIZE))) : (n))
 #define LWS_SEND_BUFFER_PRE_PADDING _LWS_PAD(4 + 10 + (2 * MAX_MUX_RECURSION))
 #define LWS_SEND_BUFFER_POST_PADDING 4