mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:16:04 +00:00
- Revert 22081 by Magnus Olsen:
"fixing two hiden bug in reactos, null termante the string right at end, code tested in vs, but it seam no affact on wine test mscvrt printf test. What hell is the snprintf function call to ??". Instead of fixing "hidden bugs", it introduced a real very well hidden bug, which was overwriting the target buffer and thus corrupting everything starting from the heap, and ending with pools. It's possible to install and run OO2 Writer now. See issue #3311 for more details. svn path=/trunk/; revision=34180
This commit is contained in:
parent
452122a506
commit
0bb26e2025
2 changed files with 3 additions and 27 deletions
|
@ -691,20 +691,8 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
|
|||
if (str <= end)
|
||||
*str = '\0';
|
||||
else if (cnt > 0)
|
||||
{
|
||||
/* don't write out a null byte if the buf size is zero */
|
||||
//*end = '\0';
|
||||
if (str-buf >cnt )
|
||||
{
|
||||
*end = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
end++;
|
||||
*end = '\0';
|
||||
}
|
||||
|
||||
}
|
||||
*end = '\0';
|
||||
return str-buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -689,21 +689,9 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar
|
|||
}
|
||||
if (str <= end)
|
||||
*str = L'\0';
|
||||
else if (cnt > 0)
|
||||
{
|
||||
else if (cnt > 0)
|
||||
/* don't write out a null byte if the buf size is zero */
|
||||
//*end = '\0';
|
||||
if (str-buf >cnt )
|
||||
{
|
||||
*end = L'\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
end++;
|
||||
*end = L'\0';
|
||||
}
|
||||
|
||||
}
|
||||
*end = L'\0';
|
||||
return str-buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue