diff --git a/libraries/AP_Logger/AP_Logger.cpp b/libraries/AP_Logger/AP_Logger.cpp index 43bdad5952..55d2a02fa0 100644 --- a/libraries/AP_Logger/AP_Logger.cpp +++ b/libraries/AP_Logger/AP_Logger.cpp @@ -1187,9 +1187,9 @@ AP_Logger::log_write_fmt *AP_Logger::msg_fmt_for_name(const char *name, const ch memcpy((char*)ls_strings.format, f->fmt, MIN(sizeof(ls_strings.format), strlen(f->fmt))); memcpy((char*)ls_strings.labels, f->labels, MIN(sizeof(ls_strings.labels), strlen(f->labels))); if (f->units != nullptr) { - memcpy((char*)ls_strings.units, f->units, MIN(sizeof(ls.units), strlen(f->units))); + memcpy((char*)ls_strings.units, f->units, MIN(sizeof(ls_strings.units), strlen(f->units))); } else { - memset((char*)ls_strings.units, '?', MIN(sizeof(ls.format), strlen(f->fmt))); + memset((char*)ls_strings.units, '?', MIN(sizeof(ls_strings.format), strlen(f->fmt))); } if (f->mults != nullptr) { memcpy((char*)ls_strings.multipliers, f->mults, MIN(sizeof(ls_strings.multipliers), strlen(f->mults))); diff --git a/libraries/AP_Scripting/lua_bindings.cpp b/libraries/AP_Scripting/lua_bindings.cpp index 45f0bd7a94..580b417cc9 100644 --- a/libraries/AP_Scripting/lua_bindings.cpp +++ b/libraries/AP_Scripting/lua_bindings.cpp @@ -130,7 +130,7 @@ int AP_Logger_Write(lua_State *L) { struct AP_Logger::log_write_fmt *f; if (!have_units) { // ask for a mesage type - f = AP_logger->msg_fmt_for_name(name, label_cat, nullptr, nullptr, fmt_cat, true); + f = AP_logger->msg_fmt_for_name(name, label_cat, nullptr, nullptr, fmt_cat, true, true); } else { // read in units and multiplers strings @@ -153,7 +153,7 @@ int AP_Logger_Write(lua_State *L) { strcat(multipliers_cat,multipliers); // ask for a mesage type - f = AP_logger->msg_fmt_for_name(name, label_cat, units_cat, multipliers_cat, fmt_cat, true); + f = AP_logger->msg_fmt_for_name(name, label_cat, units_cat, multipliers_cat, fmt_cat, true, true); } if (f == nullptr) {