mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 13:03:06 +01:00
Fixed snprintf.
This commit is contained in:
@@ -1124,8 +1124,7 @@ namespace bx
|
||||
{
|
||||
if (1 < _max)
|
||||
{
|
||||
StaticMemoryBlockWriter writer(_out, uint32_t(_max-1) );
|
||||
_out[_max-1] = '\0';
|
||||
StaticMemoryBlockWriter writer(_out, uint32_t(_max) );
|
||||
|
||||
Error err;
|
||||
va_list argListCopy;
|
||||
@@ -1138,6 +1137,10 @@ namespace bx
|
||||
size += write(&writer, '\0', &err);
|
||||
return size - 1 /* size without '\0' terminator */;
|
||||
}
|
||||
else
|
||||
{
|
||||
_out[_max-1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
Error err;
|
||||
|
||||
Reference in New Issue
Block a user