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
c78a9265
...
c78a92659a1ae097bd92947aeb68efd88e26d3e4
authored
2003-03-15 23:23:24 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bugfix. Thanks Wojciech for noticing!
1 parent
deaa3c28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
mh/mh_ctx.c
mh/mh_ctx.c
View file @
c78a926
...
...
@@ -48,6 +48,9 @@ mh_context_read (mh_context_t *ctx)
struct
stat
st
;
FILE
*
fp
;
if
(
!
ctx
)
return
EINVAL
;
if
(
stat
(
ctx
->
name
,
&
st
))
return
errno
;
...
...
@@ -79,6 +82,9 @@ mh_context_write (mh_context_t *ctx)
size_t
off
=
0
,
n
;
FILE
*
fp
;
if
(
!
ctx
)
return
EINVAL
;
fp
=
fopen
(
ctx
->
name
,
"w"
);
if
(
!
fp
)
{
...
...
@@ -117,7 +123,7 @@ mh_context_get_value (mh_context_t *ctx, const char *name, const char *defval)
{
char
*
p
;
if
(
header_aget_value
(
ctx
->
header
,
name
,
&
p
))
if
(
!
ctx
||
header_aget_value
(
ctx
->
header
,
name
,
&
p
))
p
=
(
char
*
)
defval
;
return
p
;
}
...
...
@@ -125,6 +131,8 @@ mh_context_get_value (mh_context_t *ctx, const char *name, const char *defval)
int
mh_context_set_value
(
mh_context_t
*
ctx
,
const
char
*
name
,
const
char
*
value
)
{
if
(
!
ctx
)
return
EINVAL
;
if
(
!
ctx
->
header
)
{
int
rc
;
...
...
@@ -145,6 +153,8 @@ mh_context_iterate (mh_context_t *ctx, mh_context_iterator fp, void *data)
size_t
i
,
nfields
;
int
rc
=
0
;
if
(
!
ctx
)
return
EINVAL
;
header_get_field_count
(
ctx
->
header
,
&
nfields
);
for
(
i
=
1
;
i
<=
nfields
&&
rc
==
0
;
i
++
)
{
...
...
Please
register
or
sign in
to post a comment