Update vendored msgpack-c to 4.0.0
[lttng-tools.git] / src / vendor / msgpack / fbuffer.h
index d478008c8d65b72484aeba5ac93e9804fe9aef35..5c847dd97b32c6740c9b4efe67f794145439cd28 100644 (file)
@@ -11,6 +11,7 @@
 #define MSGPACK_FBUFFER_H
 
 #include <stdio.h>
+#include <assert.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -25,6 +26,9 @@ extern "C" {
 
 static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len)
 {
+    assert(buf || len == 0);
+    if(!buf) return 0;
+
     return (1 == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
 }
 
This page took 0.023376 seconds and 4 git commands to generate.