Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
60eb44d8
Commit
60eb44d8
authored
Jun 27, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't touch _bufsiz value while initializing FILE structure.
parent
fffbc8e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
file.c
dlls/msvcrt/file.c
+3
-1
file.c
dlls/msvcrt/tests/file.c
+17
-2
No files found.
dlls/msvcrt/file.c
View file @
60eb44d8
...
...
@@ -458,9 +458,11 @@ static int msvcrt_init_fp(MSVCRT_FILE* file, int fd, unsigned stream_flags)
*
MSVCRT__errno
()
=
MSVCRT_EBADF
;
return
-
1
;
}
memset
(
file
,
0
,
sizeof
(
*
file
));
file
->
_ptr
=
file
->
_base
=
NULL
;
file
->
_cnt
=
0
;
file
->
_file
=
fd
;
file
->
_flag
=
stream_flags
;
file
->
_tmpfname
=
NULL
;
TRACE
(
":got FILE* (%p)
\n
"
,
file
);
return
0
;
...
...
dlls/msvcrt/tests/file.c
View file @
60eb44d8
...
...
@@ -1628,7 +1628,7 @@ static void test_fopen_s( void )
const
char
name
[]
=
"empty1"
;
char
buff
[
16
];
unsigned
char
*
ubuff
=
(
unsigned
char
*
)
buff
;
FILE
*
file
;
FILE
*
file
,
*
file2
;
int
ret
;
int
len
;
...
...
@@ -1719,6 +1719,22 @@ static void test_fopen_s( void )
ubuff
[
0
],
ubuff
[
1
],
ubuff
[
2
]);
fclose
(
file
);
/* test initial FILE values */
memset
(
file
,
0xfe
,
sizeof
(
*
file
));
file
->
_flag
=
0
;
ret
=
p_fopen_s
(
&
file2
,
name
,
"r"
);
ok
(
!
ret
,
"fopen_s failed with %d
\n
"
,
ret
);
ok
(
file
==
file2
,
"file != file2 %p %p
\n
"
,
file
,
file2
);
ok
(
!
file
->
_ptr
,
"file->_ptr != NULL
\n
"
);
ok
(
!
file
->
_cnt
,
"file->_cnt != 0
\n
"
);
ok
(
!
file
->
_base
,
"file->_base != NULL
\n
"
);
ok
(
file
->
_flag
==
1
,
"file->_flag = %x
\n
"
,
file
->
_flag
);
ok
(
file
->
_file
,
"file->_file == 0
\n
"
);
ok
(
file
->
_charbuf
==
0xfefefefe
,
"file->_charbuf = %x
\n
"
,
file
->
_charbuf
);
ok
(
file
->
_bufsiz
==
0xfefefefe
,
"file->_bufsiz = %x
\n
"
,
file
->
_bufsiz
);
ok
(
!
file
->
_tmpfname
,
"file->_tmpfname != NULL
\n
"
);
fclose
(
file2
);
ok
(
_unlink
(
name
)
==
0
,
"Couldn't unlink file named '%s'
\n
"
,
name
);
}
...
...
@@ -2273,7 +2289,6 @@ static void test_write_flush(void)
file
=
fopen
(
tempf
,
"wb+"
);
ok
(
file
!=
NULL
,
"unable to create test file
\n
"
);
iobuf
[
0
]
=
0
;
fwrite
(
iobuf
,
1
,
1
,
file
);
/* needed for wine to init _bufsiz */
ok
(
file
->
_bufsiz
==
4096
,
"incorrect default buffer size: %d
\n
"
,
file
->
_bufsiz
);
test_write_flush_size
(
file
,
file
->
_bufsiz
);
setvbuf
(
file
,
iobuf
,
_IOFBF
,
sizeof
(
iobuf
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment