Author: greatlrd
Date: Sun May 21 17:38:45 2006
New Revision: 21964
URL: http://svn.reactos.ru/svn/reactos?rev=21964&view=rev
Log:
reporting djgpp fgets to fgetws, with wine test the old version did fail on reading string, it did to far.
now we do not have a any bug in fgetws, acoding wine test, I ran the test in win2k and reactos to be 100% sure it was not wine test fualt.
Modified:
trunk/reactos/lib/crt/stdio/fgetws.c
Modified: trunk/reactos/lib/crt/stdio/fgetws.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/crt/stdio/fgetws.c?rev=…
==============================================================================
--- trunk/reactos/lib/crt/stdio/fgetws.c (original)
+++ trunk/reactos/lib/crt/stdio/fgetws.c Sun May 21 17:38:45 2006
@@ -32,23 +32,19 @@
wchar_t* fgetws(wchar_t* s, int n, FILE* f)
{
- wchar_t c = 0;
- wchar_t* cs;
+
+ int c=0;
+ wchar_t *cs;
cs = s;
- //while (--n > 0 && (c = getwc(f)) != WEOF) {
- while (n > 0) {
- c = getwc(f);
- if (c == WEOF)
- break;
- n--;
+ while (--n>0 && (c = getwc(f)) != WEOF)
+ {
*cs++ = c;
if (c == L'\n')
break;
}
- if (c == WEOF && cs == s) {
+ if (c == WEOF && cs == s)
return NULL;
- }
*cs++ = L'\0';
return s;
}