sdlog2: code style fixed

This commit is contained in:
Anton Babushkin
2014-03-07 11:18:31 +04:00
parent e505f4fae5
commit 80595c177a
3 changed files with 29 additions and 12 deletions
+2 -1
View File
@@ -74,8 +74,9 @@ bool logbuffer_write(struct logbuffer_s *lb, void *ptr, int size)
// bytes available to write
int available = lb->read_ptr - lb->write_ptr - 1;
if (available < 0)
if (available < 0) {
available += lb->size;
}
if (size > available) {
// buffer overflow