forked from Archive/PX4-Autopilot
Fixed va args in MAVLink, tested with RC config, correct output
This commit is contained in:
parent
d720944efe
commit
5dfde44c56
|
@ -103,13 +103,12 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
struct mavlink_logmessage msg;
|
char text[MAVLINK_LOG_MAXLEN + 1];
|
||||||
msg.severity = severity;
|
vsnprintf(text, sizeof(text), fmt, ap);
|
||||||
vsnprintf(msg.text, sizeof(msg.text), fmt, ap);
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
::ioctl(_fd, msg.severity, (unsigned long)msg.text);
|
::ioctl(_fd, severity, (unsigned long)&text[0]);
|
||||||
#else
|
#else
|
||||||
ioctl(_fd, msg.severity, (unsigned long)msg.text);
|
ioctl(_fd, severity, (unsigned long)&text[0]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue