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
fb8b9d9f
...
fb8b9d9f7daee8185101e7438039c98f2345ccff
authored
2000-11-15 04:21:58 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
minor nit in set_value, and I'm not sure it is a good fix.
1 parent
41d545f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
mailbox/header.c
mailbox/header.c
View file @
fb8b9d9
...
...
@@ -259,14 +259,29 @@ header_set_value (header_t header, const char *fn, const char *fv, int replace)
blurb
=
calloc
(
header
->
blurb_len
+
len
+
2
,
1
);
if
(
blurb
==
NULL
)
return
ENOMEM
;
sprintf
(
blurb
,
"%s: %s
\n
"
,
fn
,
fv
);
sprintf
(
blurb
,
"%s: %s"
,
fn
,
fv
);
/* Strip off trailing newlines. */
while
(
blurb
[
strlen
(
blurb
)
-
1
]
==
'\n'
)
{
blurb
[
strlen
(
blurb
)
-
1
]
=
'\0'
;
}
len
=
strlen
(
blurb
);
blurb
[
len
]
=
'\n'
;
len
++
;
/* Prepend the rest of the headers. */
if
(
header
->
blurb
)
{
memcpy
(
blurb
+
len
,
header
->
blurb
,
header
->
blurb_len
);
free
(
header
->
blurb
);
}
else
blurb
[
len
]
=
'\n'
;
/* before parsing the new blurb make sure it is properly terminated
by \n\n. The trailing NL separtor. */
by \n\n. The trailing NL separ
a
tor. */
if
(
blurb
[
header
->
blurb_len
+
len
-
1
]
!=
'\n'
||
blurb
[
header
->
blurb_len
+
len
-
2
]
!=
'\n'
)
{
...
...
Please
register
or
sign in
to post a comment