Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-10-20 18:52:43 +0400
committerCorinna Vinschen <corinna@vinschen.de>2009-10-20 18:52:43 +0400
commitc94a1006c62d655fd44abcd527ebfdbe4f36702a (patch)
tree54fe426c11e21a9306e32522ef88f1f764b19cef /winsup/cygwin/smallprint.cc
parentcbea3f7d93e19af536ed8ba8225fb02454dac8ca (diff)
* smallprint.cc (__small_vsprintf): Simplify UNICODE string handling
and allow empty strings.
Diffstat (limited to 'winsup/cygwin/smallprint.cc')
-rw-r--r--winsup/cygwin/smallprint.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc
index 9a5cd1ac0..bf6fd67eb 100644
--- a/winsup/cygwin/smallprint.cc
+++ b/winsup/cygwin/smallprint.cc
@@ -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: