mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 07:51:36 +08:00
Fix va_arg calls (always call va_end)
From the manpage: "Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function."
This commit is contained in:
committed by
Lorenz Meier
parent
b845edba64
commit
453937a89a
@@ -64,6 +64,7 @@ ekf_debug(const char *fmt, ...)
|
|||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
ekf_debug_print(fmt, args);
|
ekf_debug_print(fmt, args);
|
||||||
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ void mTecs::debug(const char *fmt, ...)
|
|||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
debug_print(fmt, args);
|
debug_print(fmt, args);
|
||||||
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace fwPosctrl */
|
} /* namespace fwPosctrl */
|
||||||
|
|||||||
@@ -102,7 +102,9 @@ err(int exitcode, const char *fmt, ...)
|
|||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
verr(exitcode, fmt, args);
|
warnerr_core(errno, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -118,7 +120,9 @@ errc(int exitcode, int errcode, const char *fmt, ...)
|
|||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
verrc(exitcode, errcode, fmt, args);
|
warnerr_core(errcode, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -134,7 +138,9 @@ errx(int exitcode, const char *fmt, ...)
|
|||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
verrx(exitcode, fmt, args);
|
warnerr_core(NOCODE, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ void qurt_log(const char *fmt, ...)
|
|||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
printf(fmt, args);
|
printf(fmt, args);
|
||||||
printf("n");
|
printf("n");
|
||||||
|
va_end(args);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user