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
c104ecab
...
c104ecaba998d80b72a91be38b0a248a7764911f
authored
2003-01-15 17:38:05 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Shut compiler warnings.
1 parent
ef694308
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
mh/mh_ctx.c
mh/mh_ctx.c
View file @
c104eca
...
...
@@ -71,7 +71,7 @@ mh_context_read (mh_context_t *ctx)
fread
(
blurb
,
st
.
st_size
,
1
,
fp
);
fclose
(
fp
);
if
(
status
=
header_create
(
&
ctx
->
header
,
blurb
,
st
.
st_size
,
NULL
))
if
(
(
status
=
header_create
(
&
ctx
->
header
,
blurb
,
st
.
st_size
,
NULL
))
!=
0
)
free
(
blurb
);
return
status
;
...
...
@@ -111,14 +111,20 @@ mh_context_write (mh_context_t *ctx)
Instead, it should return a const pointer to the static storage within
the header_t structure and be declared as
`const char *mh_context_get_value()'. Current implementation of
header_.* functions does not allow that. */
header_.* functions does not allow that.
This has two drawbacks:
1) The function is declared as returning char * instead of
intended const char *.
2) Ugly typecast when returning defval. */
char
*
mh_context_get_value
(
mh_context_t
*
ctx
,
const
char
*
name
,
const
char
*
defval
)
{
char
*
p
;
if
(
header_aget_value
(
ctx
->
header
,
name
,
&
p
))
p
=
defval
;
p
=
(
char
*
)
defval
;
return
p
;
}
...
...
Please
register
or
sign in
to post a comment