mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:24:58 +00:00
LibC: Automatically append null terminator in vswprintf
This commit is contained in:
parent
96db8d64f6
commit
b0b8d14a2c
1 changed files with 4 additions and 0 deletions
|
@ -207,6 +207,10 @@ int vswprintf(wchar_t* __restrict wcs, size_t max_length, wchar_t const* __restr
|
||||||
++length_so_far;
|
++length_so_far;
|
||||||
},
|
},
|
||||||
wcs, fmt, args);
|
wcs, fmt, args);
|
||||||
|
if (length_so_far < max_length)
|
||||||
|
wcs[length_so_far] = L'\0';
|
||||||
|
else
|
||||||
|
wcs[max_length - 1] = L'\0';
|
||||||
return static_cast<int>(length_so_far);
|
return static_cast<int>(length_so_far);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue