Mark MIN and MAX as macros as they have side effects.
[darkstat] / decode.c
index fbc974a..9c35eb1 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -127,7 +127,7 @@ getlinkhdr(const int linktype)
 int
 getsnaplen(const struct linkhdr *lh)
 {
-   return (int)(lh->hdrlen + IPV6_HDR_LEN + max(TCP_HDR_LEN, UDP_HDR_LEN));
+   return (int)(lh->hdrlen + IPV6_HDR_LEN + MAX(TCP_HDR_LEN, UDP_HDR_LEN));
 }
 
 /* Decoding functions. */