AP_HAL: Fix bad buffer termination

This commit is contained in:
Michael du Breuil 2019-08-19 18:00:58 -07:00 committed by Francisco Ferreira
parent 4954c190da
commit e47f97c5d3

View File

@ -59,7 +59,7 @@ int AP_HAL::Util::vsnprintf(char* str, size_t size, const char *format, va_list
print_vprintf(&buf, format, ap);
// null terminate
int ret = buf._offs;
buf.write(0);
str[ret] = '\0';
return ret;
}