Update vendored msgpack-c to 4.0.0
[lttng-tools.git] / src / vendor / msgpack / zbuffer.h
index 524906fab145bffe3b52e02c51f9b42d58e96f6c..c38d627e7098682a100123d59d83a398ffe38e0b 100644 (file)
@@ -13,6 +13,7 @@
 #include "sysdep.h"
 #include <stdlib.h>
 #include <string.h>
+#include <assert.h>
 #include <zlib.h>
 
 #ifdef __cplusplus
@@ -121,6 +122,9 @@ static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len)
 {
     msgpack_zbuffer* zbuf = (msgpack_zbuffer*)data;
 
+    assert(buf || len == 0);
+    if(!buf) return 0;
+
     zbuf->stream.next_in = (Bytef*)buf;
     zbuf->stream.avail_in = (uInt)len;
 
This page took 0.024377 seconds and 4 git commands to generate.