projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: log error message when libkmod operations fail
[lttng-tools.git]
/
src
/
vendor
/
msgpack
/
sbuffer.h
diff --git
a/src/vendor/msgpack/sbuffer.h
b/src/vendor/msgpack/sbuffer.h
index c494bae77a5e13225fb5f020e6eee0fd268397d9..572d8f27e683ed33704acae9a761db893e351810 100644
(file)
--- a/
src/vendor/msgpack/sbuffer.h
+++ b/
src/vendor/msgpack/sbuffer.h
@@
-12,6
+12,7
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
@@
-60,6
+61,9
@@
static inline int msgpack_sbuffer_write(void* data, const char* buf, size_t len)
{
msgpack_sbuffer* sbuf = (msgpack_sbuffer*)data;
{
msgpack_sbuffer* sbuf = (msgpack_sbuffer*)data;
+ assert(buf || len == 0);
+ if(!buf) return 0;
+
if(sbuf->alloc - sbuf->size < len) {
void* tmp;
size_t nsize = (sbuf->alloc) ?
if(sbuf->alloc - sbuf->size < len) {
void* tmp;
size_t nsize = (sbuf->alloc) ?
@@
-83,6
+87,7
@@
static inline int msgpack_sbuffer_write(void* data, const char* buf, size_t len)
memcpy(sbuf->data + sbuf->size, buf, len);
sbuf->size += len;
memcpy(sbuf->data + sbuf->size, buf, len);
sbuf->size += len;
+
return 0;
}
return 0;
}
This page took
0.024384 seconds
and
4
git commands to generate.