diff --git a/reactos/lib/ntdll/stdio/sprintf.c b/reactos/lib/ntdll/stdio/sprintf.c index 7e35e691431..445abfd18e4 100644 --- a/reactos/lib/ntdll/stdio/sprintf.c +++ b/reactos/lib/ntdll/stdio/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.2 2000/02/21 22:37:57 ekohl Exp $ +/* $Id: sprintf.c,v 1.3 2000/02/27 15:43:58 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -317,7 +317,7 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) while ((*s) != 0) *str++ = *s++; } else { - for (i = 0; pus->Buffer[i] && i < pus->Length; i++) + for (i = 0; pus->Buffer[i] && i < pus->Length / sizeof(WCHAR); i++) *str++ = (unsigned char)(pus->Buffer[i]); } } else { diff --git a/reactos/lib/ntdll/stdio/swprintf.c b/reactos/lib/ntdll/stdio/swprintf.c index 6bca4055ff5..75cb70c9d83 100644 --- a/reactos/lib/ntdll/stdio/swprintf.c +++ b/reactos/lib/ntdll/stdio/swprintf.c @@ -1,4 +1,4 @@ -/* $Id: swprintf.c,v 1.4 2000/02/21 22:37:57 ekohl Exp $ +/* $Id: swprintf.c,v 1.5 2000/02/27 15:43:58 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -341,7 +341,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) while ((*sw) != 0) *str++ = *sw++; } else { - for (i = 0; pus->Buffer[i] && i < pus->Length; i++) + for (i = 0; pus->Buffer[i] && i < pus->Length / sizeof(WCHAR); i++) *str++ = pus->Buffer[i]; } } diff --git a/reactos/ntoskrnl/rtl/sprintf.c b/reactos/ntoskrnl/rtl/sprintf.c index d84a91dcfcf..cee03aa3614 100644 --- a/reactos/ntoskrnl/rtl/sprintf.c +++ b/reactos/ntoskrnl/rtl/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.2 2000/02/21 22:41:45 ekohl Exp $ +/* $Id: sprintf.c,v 1.3 2000/02/27 15:43:10 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -316,7 +316,7 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) while ((*s) != 0) *str++ = *s++; } else { - for (i = 0; pus->Buffer[i] && i < pus->Length; i++) + for (i = 0; pus->Buffer[i] && i < pus->Length / sizeof(WCHAR); i++) *str++ = (unsigned char)(pus->Buffer[i]); } } else { diff --git a/reactos/ntoskrnl/rtl/swprintf.c b/reactos/ntoskrnl/rtl/swprintf.c index 8b896f1fb03..46e86085643 100644 --- a/reactos/ntoskrnl/rtl/swprintf.c +++ b/reactos/ntoskrnl/rtl/swprintf.c @@ -1,4 +1,4 @@ -/* $Id: swprintf.c,v 1.2 2000/02/21 22:41:45 ekohl Exp $ +/* $Id: swprintf.c,v 1.3 2000/02/27 15:43:10 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -123,11 +123,11 @@ number (wchar_t *str, long long num, int base, int size, int precision, { if (base==8) { - *str++ = L'0'; + *str++ = L'0'; } else if (base==16) { - *str++ = L'0'; + *str++ = L'0'; *str++ = digits[33]; } } @@ -321,7 +321,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) } continue; - case 'Z': + case L'Z': if (qualifier == 'h') { /* print counted ascii string */ PANSI_STRING pus = va_arg(args, PANSI_STRING); @@ -341,7 +341,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) while ((*sw) != 0) *str++ = *sw++; } else { - for (i = 0; pus->Buffer[i] && i < pus->Length; i++) + for (i = 0; pus->Buffer[i] && i < pus->Length / sizeof(WCHAR); i++) *str++ = pus->Buffer[i]; } }