1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 12:42:30 +04:00

fix: Ensure proper closure of variadic function in mjs_array (#3798)

The changes ensure that the `va_end` function is always called after `c_vsnprintf` in `mjs_array.c`

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
DerSkythe
2024-07-31 21:12:26 +04:00
committed by GitHub
parent 01b402ba2b
commit 56fef61c66

View File

@@ -19,8 +19,11 @@
static int v_sprintf_s(char* buf, size_t size, const char* fmt, ...) {
size_t n;
va_list ap;
va_start(ap, fmt);
n = c_vsnprintf(buf, size, fmt, ap);
va_end(ap);
if(n > size) {
return size;
}