small regressions.
[apps/madmutt.git] / send.c
diff --git a/send.c b/send.c
index 86a6f35..acb01af 100644 (file)
--- a/send.c
+++ b/send.c
@@ -292,7 +292,7 @@ static void process_user_recips (ENVELOPE * env)
         if (!p)
             continue;
 
-        switch (mime_which_token(uh->data, p - uh->data)) {
+        switch (mime_which_token(uh->data, p++ - uh->data)) {
           case MIME_TO:
             env->to = rfc822_parse_adrlist(env->to, p);
             break;
@@ -325,8 +325,10 @@ static void process_user_header(ENVELOPE * env)
 
     for (uh = UserHeader; uh; uh = uh->next) {
         const char *p = strchr(uh->data, ':');
+        if (!p)
+          continue;
 
-        switch (mime_which_token(uh->data, (p ?: uh->data) - uh->data)) {
+        switch (mime_which_token(uh->data, p++ - uh->data)) {
           case MIME_FROM:
             /* User has specified a default From: address.  Remove default address */
             address_list_wipe(&env->from);