summaryrefslogtreecommitdiffstats
path: root/headers.c
diff options
context:
space:
mode:
authorMichael Elkins <me@sigpipe.org>2012-12-18 13:50:20 -0800
committerMichael Elkins <me@sigpipe.org>2012-12-18 13:50:20 -0800
commit90eb6a39d4d977d85b3d9ab04f0792e22fa655a1 (patch)
treedd64b99e62fcaf91f64969de619cdcc3fa0b2fa9 /headers.c
parent30831a33248f14718e200eb4548f9c5f73ca2b05 (diff)
rename iswsp() to is_email_wsp()
add new inline funtion skip_email_wsp() to be used in lieu of SKIPWS() when parsing ASCII protocols rather than user input. change use of SKIPWS() to skip_email_wsp() in places where it is likely to be a problem.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/headers.c b/headers.c
index 72ee3eb2..902eb9b8 100644
--- a/headers.c
+++ b/headers.c
@@ -36,7 +36,7 @@ void mutt_edit_headers (const char *editor,
{
char path[_POSIX_PATH_MAX]; /* tempfile used to edit headers + body */
char buffer[LONG_STRING];
- char *p;
+ const char *p;
FILE *ifp, *ofp;
int i, keep;
ENVELOPE *n;
@@ -141,8 +141,7 @@ void mutt_edit_headers (const char *editor,
if (fcc && ascii_strncasecmp ("fcc:", cur->data, 4) == 0)
{
- p = cur->data + 4;
- SKIPWS (p);
+ p = skip_email_wsp(cur->data + 4);
if (*p)
{
strfcpy (fcc, p, fcclen);
@@ -154,10 +153,9 @@ void mutt_edit_headers (const char *editor,
{
BODY *body;
BODY *parts;
- int l = 0;
+ size_t l = 0;
- p = cur->data + 7;
- SKIPWS (p);
+ p = skip_email_wsp(cur->data + 7);
if (*p)
{
for ( ; *p && *p != ' ' && *p != '\t'; p++)
@@ -171,9 +169,7 @@ void mutt_edit_headers (const char *editor,
if (l < sizeof (path) - 1)
path[l++] = *p;
}
- if (*p)
- *p++ = 0;
- SKIPWS (p);
+ p = skip_email_wsp(p);
path[l] = 0;
mutt_expand_path (path, sizeof (path));