mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Enable %wZ and %Z format specifiers (remove #if 0).
Fix check for NULL Buffer (it was checking for non-null Buffer). Fix length field when printing unicode strings; it was printing twice as many characters as it should have. (Patch by Joseph Galbraith) svn path=/trunk/; revision=3091
This commit is contained in:
parent
165c6d209a
commit
6017a8515d
2 changed files with 6 additions and 10 deletions
|
@ -693,23 +693,22 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
|||
}
|
||||
continue;
|
||||
|
||||
#if 0
|
||||
case 'Z':
|
||||
if (qualifier == 'w') {
|
||||
/* print counted unicode string */
|
||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||
if ((pus == NULL) || (pus->Buffer)) {
|
||||
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||
s = "<NULL>";
|
||||
while ((*s) != 0)
|
||||
putc(*s++, f);
|
||||
} else {
|
||||
for (i = 0; pus->Buffer[i] && i < pus->Length; i++)
|
||||
for (i = 0; pus->Buffer[i] && i < pus->Length / sizeof(WCHAR); i++)
|
||||
putc((unsigned char)(pus->Buffer[i]), f);
|
||||
}
|
||||
} else {
|
||||
/* print counted ascii string */
|
||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||
if ((pus == NULL) || (pus->Buffer)) {
|
||||
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||
s = "<NULL>";
|
||||
while ((*s) != 0)
|
||||
putc(*s++, f);
|
||||
|
@ -719,7 +718,6 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
|||
}
|
||||
}
|
||||
continue;
|
||||
#endif
|
||||
|
||||
case 'e':
|
||||
case 'E':
|
||||
|
|
|
@ -694,23 +694,22 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
|||
}
|
||||
continue;
|
||||
|
||||
#if 0
|
||||
case 'Z':
|
||||
if (qualifier == 'w') {
|
||||
/* print counted unicode string */
|
||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||
if ((pus == NULL) || (pus->Buffer)) {
|
||||
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||
s = "<NULL>";
|
||||
while ((*s) != 0)
|
||||
putc(*s++, f);
|
||||
} else {
|
||||
for (i = 0; pus->Buffer[i] && i < pus->Length; i++)
|
||||
for (i = 0; pus->Buffer[i] && i < pus->Length / sizeof(WCHAR); i++)
|
||||
putc((unsigned char)(pus->Buffer[i]), f);
|
||||
}
|
||||
} else {
|
||||
/* print counted ascii string */
|
||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||
if ((pus == NULL) || (pus->Buffer)) {
|
||||
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||
s = "<NULL>";
|
||||
while ((*s) != 0)
|
||||
putc(*s++, f);
|
||||
|
@ -720,7 +719,6 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
|||
}
|
||||
}
|
||||
continue;
|
||||
#endif
|
||||
|
||||
case 'e':
|
||||
case 'E':
|
||||
|
|
Loading…
Reference in a new issue