sdlog2 -b option (log buffer size) added, minor cleanup

This commit is contained in:
Anton Babushkin
2013-06-07 22:02:40 +04:00
parent d39999425d
commit 59b26eca48
3 changed files with 40 additions and 17 deletions
+2 -1
View File
@@ -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)