Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
0ab9348b
...
0ab9348b020703a81ffe37420418fb9e6117e47b
authored
2002-11-29 09:33:31 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(_stdin_file_read): Test for eof condition.
1 parent
1d95c0dd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
mailbox/file_stream.c
mailbox/file_stream.c
View file @
0ab9348
...
...
@@ -177,7 +177,7 @@ static int
_stdin_file_read
(
stream_t
stream
,
char
*
optr
,
size_t
osize
,
off_t
offset
,
size_t
*
pnbytes
)
{
int
status
;
int
status
=
0
;
size_t
nbytes
;
struct
_file_stream
*
fs
=
stream_get_owner
(
stream
);
int
fs_offset
=
fs
->
offset
;
...
...
@@ -212,6 +212,11 @@ _stdin_file_read (stream_t stream, char *optr, size_t osize,
if
(
status
)
return
status
;
}
if
(
feof
(
fs
->
file
))
nbytes
=
0
;
else
{
status
=
_file_read
(
stream
,
optr
,
osize
,
fs_offset
,
&
nbytes
);
if
(
status
==
0
&&
nbytes
)
{
...
...
@@ -223,6 +228,7 @@ _stdin_file_read (stream_t stream, char *optr, size_t osize,
if
(
k
!=
nbytes
)
return
EIO
;
}
}
if
(
pnbytes
)
*
pnbytes
=
nbytes
;
return
status
;
...
...
Please
register
or
sign in
to post a comment