From 6ea2d31a1e7f35608fef5dae26a20c54d5b94bbc Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 19 Nov 2005 14:23:33 +0000 Subject: [PATCH] "sync up sprintf.c with swprintf.c. They both do the same except one is the wchar-version, so they shouldn't differ in other parts." by Elrond svn path=/trunk/; revision=19344 --- reactos/lib/rtl/sprintf.c | 11 +++++++---- reactos/lib/rtl/swprintf.c | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/reactos/lib/rtl/sprintf.c b/reactos/lib/rtl/sprintf.c index cd958e2e696..c8b1e6af911 100644 --- a/reactos/lib/rtl/sprintf.c +++ b/reactos/lib/rtl/sprintf.c @@ -2,6 +2,8 @@ * PROGRAMMERS: David Welch * Eric Kohl * + * TODO: + * - Verify the implementation of '%Z'. */ /* @@ -14,6 +16,7 @@ /* * Wirzenius wrote this portably, Torvalds fucked it up :-) */ + #include #define ZEROPAD 1 /* pad with zero */ @@ -84,7 +87,7 @@ number(char * buf, char * end, long long num, int base, int size, int precision, } i = 0; if (num == 0) - tmp[i++]='0'; + tmp[i++] = '0'; else while (num != 0) tmp[i++] = digits[do_div(&num,base)]; if (i > precision) @@ -214,19 +217,19 @@ stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int p { if (buf <= end) *buf = ' '; - ++buf; + buf++; } for (i = 0; i < len; ++i) { if (buf <= end) *buf = (unsigned char)(*sw++); - ++buf; + buf++; } while (len < field_width--) { if (buf <= end) *buf = ' '; - ++buf; + buf++; } return buf; } diff --git a/reactos/lib/rtl/swprintf.c b/reactos/lib/rtl/swprintf.c index 294e8d9eb79..b8c2d2ba670 100644 --- a/reactos/lib/rtl/swprintf.c +++ b/reactos/lib/rtl/swprintf.c @@ -537,6 +537,9 @@ int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...) } +/* + * @implemented + */ int vswprintf(wchar_t *buf, const wchar_t *fmt, va_list args) { return _vsnwprintf(buf,MAXLONG,fmt,args);