mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00: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:
parent
01b402ba2b
commit
56fef61c66
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue