* smallprint.cc (__small_vsprintf): Use already available buffer tmp

in wfillin case.
This commit is contained in:
Corinna Vinschen 2009-01-23 13:59:13 +00:00
parent 9895091d0d
commit dcf6bd1e04
2 changed files with 10 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2009-01-23 Corinna Vinschen <corinna@vinschen.de>
* smallprint.cc (__small_vsprintf): Use already available buffer tmp
in wfillin case.
2009-01-22 Christopher Faylor <me+cygwin@cgf.cx> 2009-01-22 Christopher Faylor <me+cygwin@cgf.cx>
* select.cc (peek_serial): Add hack to allow proper operation with * select.cc (peek_serial): Add hack to allow proper operation with

View File

@ -195,18 +195,15 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
us = va_arg (ap, PUNICODE_STRING); us = va_arg (ap, PUNICODE_STRING);
wfillin: wfillin:
{ {
char *tmpbuf; if (!sys_wcstombs (tmp, NT_MAX_PATH, us->Buffer,
if (!sys_wcstombs_alloc (&tmpbuf, HEAP_NOTHEAP, us->Buffer,
us->Length / sizeof (WCHAR))) us->Length / sizeof (WCHAR)))
{ {
s = "invalid UNICODE_STRING"; s = "invalid UNICODE_STRING";
goto fillin; goto fillin;
} }
char *tmp = tmpbuf; char *t = tmp;
for (i = 0; *tmp && i < n; i++) for (i = 0; *t && i < n; i++)
*dst++ = *tmp++; *dst++ = *t++;
free (tmpbuf);
} }
break; break;
default: default: