]> The Tcpdump Group git mirrors - tcpdump/blobdiff - cpack.c
Further cleanups.
[tcpdump] / cpack.c
diff --git a/cpack.c b/cpack.c
index d2e765d4900042520b4f2931d971b33e950f7773..c921b390591872795c8cdfbedf7fec8c4767e905 100644 (file)
--- a/cpack.c
+++ b/cpack.c
 #endif
 
 #include <stdlib.h>
+#include <string.h>
 #include <tcpdump-stdinc.h>
 
 #include "cpack.h"
 #include "extract.h"
 
-static u_int8_t *
+u_int8_t *
 cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment)
 {
        size_t misalignment = (size_t)(p - buf) % alignment;
@@ -52,7 +53,7 @@ cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment)
  * wordsize bytes remain in the buffer after the boundary.  Otherwise,
  * return a pointer to the boundary.
  */
-static u_int8_t *
+u_int8_t *
 cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
 {
        u_int8_t *next;
@@ -132,7 +133,7 @@ int
 cpack_uint8(struct cpack_state *cs, u_int8_t *u)
 {
        /* No space left? */
-       if (cs->c_next - cs->c_buf >= cs->c_len)
+       if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len)
                return -1;
 
        *u = *cs->c_next;