Fixed bugs in '%wZ' string output
authorEric Kohl <eric.kohl@reactos.org>
Sun, 27 Feb 2000 15:43:58 +0000 (15:43 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 27 Feb 2000 15:43:58 +0000 (15:43 +0000)
svn path=/trunk/; revision=1017

reactos/lib/ntdll/stdio/sprintf.c
reactos/lib/ntdll/stdio/swprintf.c
reactos/ntoskrnl/rtl/sprintf.c
reactos/ntoskrnl/rtl/swprintf.c

index 7e35e69..445abfd 100644 (file)
@@ -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 {
index 6bca405..75cb70c 100644 (file)
@@ -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];
                                }
                        }
index d84a91d..cee03aa 100644 (file)
@@ -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 {
index 8b896f1..46e8608 100644 (file)
@@ -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];
                                }
                        }