From 12dce46d611d6ea7c772174ebbd555fa10fead99 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 18 Nov 2013 08:53:22 +0100 Subject: Sanitized and improved several macros through the code - Sanitized all potentially unsafe macros (related eA:15259) - Improved some function-like macros to evaluate their argument only once and keep it in a temporary variable. This improves performance in the damage calculation related code. Signed-off-by: Haru --- src/char/char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/char/char.c') diff --git a/src/char/char.c b/src/char/char.c index f1b95474e..a1c6f73b1 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3933,7 +3933,7 @@ int parse_char(int fd) while( RFIFOREST(fd) >= 2 ) { //For use in packets that depend on an sd being present [Skotlex] - #define FIFOSD_CHECK(rest) { if(RFIFOREST(fd) < rest) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,rest); return 0; } } + #define FIFOSD_CHECK(rest) do { if(RFIFOREST(fd) < (rest)) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,(rest)); return 0; } } while (0) if( HPM->packetsc[hpParse_Char] ) { if( (i = HPM->parse_packets(fd,hpParse_Char)) ) { -- cgit v1.2.3-60-g2f50