diff options
Diffstat (limited to 'src/modules/sdlog2/logbuffer.c')
-rw-r--r-- | src/modules/sdlog2/logbuffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/sdlog2/logbuffer.c b/src/modules/sdlog2/logbuffer.c index 4205bcf20..8aaafaf31 100644 --- a/src/modules/sdlog2/logbuffer.c +++ b/src/modules/sdlog2/logbuffer.c @@ -45,12 +45,13 @@ #include "logbuffer.h" -void logbuffer_init(struct logbuffer_s *lb, int size) +int logbuffer_init(struct logbuffer_s *lb, int size) { lb->size = size; lb->write_ptr = 0; lb->read_ptr = 0; lb->data = malloc(lb->size); + return (lb->data == 0) ? ERROR : OK; } int logbuffer_count(struct logbuffer_s *lb) |