mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +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;
|
continue;
|
||||||
|
|
||||||
#if 0
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
if (qualifier == 'w') {
|
if (qualifier == 'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if ((pus == NULL) || (pus->Buffer)) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
} else {
|
} 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);
|
putc((unsigned char)(pus->Buffer[i]), f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if ((pus == NULL) || (pus->Buffer)) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
|
@ -719,7 +718,6 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
case 'E':
|
case 'E':
|
||||||
|
|
|
@ -694,23 +694,22 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if 0
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
if (qualifier == 'w') {
|
if (qualifier == 'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if ((pus == NULL) || (pus->Buffer)) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
} else {
|
} 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);
|
putc((unsigned char)(pus->Buffer[i]), f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if ((pus == NULL) || (pus->Buffer)) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
|
@ -720,7 +719,6 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
case 'E':
|
case 'E':
|
||||||
|
|
Loading…
Reference in a new issue