* smallprint.cc (__small_vsprintf): Simplify UNICODE string handling

and allow empty strings.
This commit is contained in:
Corinna Vinschen 2009-10-20 14:52:43 +00:00
parent cbea3f7d93
commit c94a1006c6
2 changed files with 9 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2009-10-20 Corinna Vinschen <corinna@vinschen.de>
* smallprint.cc (__small_vsprintf): Simplify UNICODE string handling
and allow empty strings.
2009-10-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhander_disk_file::readdir): Handle a status

View File

@ -195,16 +195,11 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
if (!us)
RtlInitUnicodeString (us = &uw, L"(null)");
wfillin:
if (sys_wcstombs (tmp, NT_MAX_PATH, us->Buffer,
us->Length / sizeof (WCHAR)))
{
if (!sys_wcstombs (tmp, NT_MAX_PATH, us->Buffer,
us->Length / sizeof (WCHAR)))
{
s = "invalid UNICODE_STRING";
goto fillin;
}
char *t = tmp;
for (i = 0; *t && i < n; i++)
*dst++ = *t++;
s = tmp;
goto fillin;
}
break;
default: