mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:15:39 +00:00
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. svn path=/trunk/; revision=21964
This commit is contained in:
parent
2ef8f0fea0
commit
c79c53d3b3
1 changed files with 6 additions and 10 deletions
|
@ -32,23 +32,19 @@
|
||||||
|
|
||||||
wchar_t* fgetws(wchar_t* s, int n, FILE* f)
|
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;
|
cs = s;
|
||||||
//while (--n > 0 && (c = getwc(f)) != WEOF) {
|
while (--n>0 && (c = getwc(f)) != WEOF)
|
||||||
while (n > 0) {
|
{
|
||||||
c = getwc(f);
|
|
||||||
if (c == WEOF)
|
|
||||||
break;
|
|
||||||
n--;
|
|
||||||
*cs++ = c;
|
*cs++ = c;
|
||||||
if (c == L'\n')
|
if (c == L'\n')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c == WEOF && cs == s) {
|
if (c == WEOF && cs == s)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
*cs++ = L'\0';
|
*cs++ = L'\0';
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue