diff --git a/reactos/lib/rtl/sprintf.c b/reactos/lib/rtl/sprintf.c index c5db46f5333..a00ff412cf0 100644 --- a/reactos/lib/rtl/sprintf.c +++ b/reactos/lib/rtl/sprintf.c @@ -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; } diff --git a/reactos/lib/rtl/swprintf.c b/reactos/lib/rtl/swprintf.c index 064de5535f4..f4851e05b4d 100644 --- a/reactos/lib/rtl/swprintf.c +++ b/reactos/lib/rtl/swprintf.c @@ -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; }