Author: greatlrd
Date: Tue Jun 6 16:45:05 2006
New Revision: 22247
URL:
http://svn.reactos.ru/svn/reactos?rev=22247&view=rev
Log:
fixing 2 more fualt in msvcrt *printf api
Modified:
trunk/reactos/lib/rtl/sprintf.c
trunk/reactos/lib/rtl/swprintf.c
Modified: trunk/reactos/lib/rtl/sprintf.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/sprintf.c?rev=22247…
==============================================================================
--- trunk/reactos/lib/rtl/sprintf.c (original)
+++ trunk/reactos/lib/rtl/sprintf.c Tue Jun 6 16:45:05 2006
@@ -115,12 +115,12 @@
size--;
}
}
+
if (type & SPECIAL) {
if (base == 16)
size -= 2;
- else if (base == 8)
- size--;
- }
+
+ }
i = 0;
if ((num == 0) && (precision !=0))
tmp[i++] = '0';
@@ -141,20 +141,18 @@
*buf = sign;
++buf;
}
+
if (type & SPECIAL) {
- if (base==8) {
+ if (base==16) {
if (buf <= end)
*buf = '0';
++buf;
- } else if (base==16) {
- if (buf <= end)
- *buf = '0';
- ++buf;
if (buf <= end)
*buf = digits[33];
++buf;
}
}
+
if (!(type & LEFT)) {
while (size-- > 0) {
if (buf <= end)
@@ -177,6 +175,7 @@
*buf = ' ';
++buf;
}
+
return buf;
}
Modified: trunk/reactos/lib/rtl/swprintf.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/swprintf.c?rev=2224…
==============================================================================
--- trunk/reactos/lib/rtl/swprintf.c (original)
+++ trunk/reactos/lib/rtl/swprintf.c Tue Jun 6 16:45:05 2006
@@ -115,12 +115,11 @@
size--;
}
}
+
if (type & SPECIAL) {
if (base == 16)
size -= 2;
- else if (base == 8)
- size--;
- }
+ }
i = 0;
if ((num == 0) && (precision !=0))
tmp[i++] = L'0';
@@ -141,12 +140,9 @@
*buf = sign;
++buf;
}
+
if (type & SPECIAL) {
- if (base==8) {
- if (buf <= end)
- *buf = L'0';
- ++buf;
- } else if (base==16) {
+ if (base==16) {
if (buf <= end)
*buf = L'0';
++buf;
@@ -177,6 +173,8 @@
*buf = L' ';
++buf;
}
+
+
return buf;
}