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
a26dd5c4
...
a26dd5c4aded95b0f7e21811a7efeb468d51d687
authored
2004-06-04 23:21:47 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(_file_read, _file_readline): Check for eof.
1 parent
b85aa07e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
mailbox/file_stream.c
mailbox/file_stream.c
View file @
a26dd5c
...
...
@@ -85,6 +85,13 @@ _file_read (stream_t stream, char *optr, size_t osize,
fs
->
offset
=
offset
;
}
if
(
feof
(
fs
->
file
))
{
if
(
nbytes
)
*
nbytes
=
0
;
return
0
;
}
n
=
fread
(
optr
,
sizeof
(
char
),
osize
,
fs
->
file
);
if
(
n
==
0
)
{
...
...
@@ -122,6 +129,13 @@ _file_readline (stream_t stream, char *optr, size_t osize,
fs
->
offset
=
offset
;
}
if
(
feof
(
fs
->
file
))
{
if
(
nbytes
)
*
nbytes
=
0
;
return
0
;
}
if
(
fgets
(
optr
,
osize
,
fs
->
file
)
!=
NULL
)
{
char
*
tmp
=
optr
;
...
...
Please
register
or
sign in
to post a comment