]> git.ozlabs.org Git - ppp.git/blobdiff - pppdump/deflate.c
For Linux, use the Linux / Glibc based defines instead of included headers
[ppp.git] / pppdump / deflate.c
index 5668a4d88067f66c86f1ad6a9e06585711f117ef..0f090b23463e45758f796f0b2cec75695dd82467 100644 (file)
@@ -41,7 +41,8 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include "ppp_defs.h"
+#include <net/ppp_defs.h>
+
 #include "ppp-comp.h"
 #include "zlib.h"
 
@@ -115,12 +116,13 @@ z_comp_stats(void *arg, struct compstat *stats)
     *stats = state->stats;
     stats->ratio = stats->unc_bytes;
     out = stats->comp_bytes + stats->unc_bytes;
-    if (stats->ratio <= 0x7ffffff)
-       stats->ratio <<= 8;
+    u_int ratio = stats->ratio;
+    if (ratio <= 0x7ffffff)
+       ratio <<= 8;
     else
        out >>= 8;
     if (out != 0)
-       stats->ratio /= out;
+       stats->ratio = ratio / out;
 }
 
 /*