Fixed missing count

This commit is contained in:
Lorenz Meier 2013-05-21 10:14:16 +02:00
parent 5dfde44c56
commit e655c0fc57
1 changed files with 8 additions and 0 deletions

View File

@ -97,6 +97,14 @@ void mavlink_logbuffer_vasprintf(struct mavlink_logbuffer *lb, int severity, con
lb->elems[end].severity = severity;
vsnprintf(lb->elems[end].text, sizeof(lb->elems[0].text), fmt, ap);
va_end(ap);
/* increase count */
if (mavlink_logbuffer_is_full(lb)) {
lb->start = (lb->start + 1) % lb->size; /* full, overwrite */
} else {
++lb->count;
}
}
__EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...)