Bug 1307080 - Fixed unsigned/signed comparison. r=jorgk,aceman
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Wed, 05 Oct 2016 13:37:00 +0200
changeset 20517 86ced6e7669214ed2e09b49aaa4bb366b864e66c
parent 20516 b2a89654fd4bef893adeee46b18c2c2bf6abb53c
child 20518 72efbbd0811ea56ea2fedf4c78a774c04cd7aa38
push id12381
push usermozilla@jorgk.com
push dateThu, 06 Oct 2016 22:25:15 +0000
treeherdercomm-central@72efbbd0811e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, aceman
bugs1307080
Bug 1307080 - Fixed unsigned/signed comparison. r=jorgk,aceman
mailnews/compose/src/nsMsgSendLater.cpp
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -927,17 +927,17 @@ nsMsgSendLater::BuildHeaders()
   PR_FREEIF(m_fcc);
   PR_FREEIF(mIdentityKey);
   PR_FREEIF(mAccountKey);
   m_flags = 0;
 
   while (buf < buf_end)
   {
     bool prune_p = false;
-    bool    do_flags_p = false;
+    bool do_flags_p = false;
     char *colon = PL_strchr(buf, ':');
     char *end;
     char *value = 0;
     char **header = 0;
     char *header_start = buf;
 
     if (! colon)
       break;
@@ -981,21 +981,20 @@ nsMsgSendLater::BuildHeaders()
       prune_p = true;
       break;
     case 'T': case 't':
       if (!PL_strncasecmp ("To", buf, end - buf))
       header = &m_to;
       break;
     case 'X': case 'x':
       {
-        int32_t headLen = PL_strlen(HEADER_X_MOZILLA_STATUS2);
-        if (headLen == end - buf &&
+        if (buf + strlen(HEADER_X_MOZILLA_STATUS2) == end &&
           !PL_strncasecmp(HEADER_X_MOZILLA_STATUS2, buf, end - buf))
           prune_p = true;
-        else if (strlen(HEADER_X_MOZILLA_STATUS) == end - buf &&
+        else if (buf + strlen(HEADER_X_MOZILLA_STATUS) == end &&
           !PL_strncasecmp(HEADER_X_MOZILLA_STATUS, buf, end - buf))
           prune_p = do_flags_p = true;
         else if (!PL_strncasecmp(HEADER_X_MOZILLA_DRAFT_INFO, buf, end - buf))
           prune_p = true;
         else if (!PL_strncasecmp(HEADER_X_MOZILLA_KEYWORDS, buf, end - buf))
           prune_p = true;
         else if (!PL_strncasecmp(HEADER_X_MOZILLA_NEWSHOST, buf, end - buf))
         {