Bug 1259040 - fix compiler warning at nsMsgMaildirStore.cpp:66 related to const unsigned cast. r=BenC
authoraceman <acelists@atlas.sk>
Tue, 15 Jan 2019 15:00:00 +0100
changeset 34215 a77b11bc0dfc1ef87b5fd047d41760fe874f93cb
parent 34214 e5d328de82dae63c2901c2417ac3bd13e520d3ba
child 34216 3ca205e21c25516d2c1d377c59179d78e9246b0d
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersBenC
bugs1259040
Bug 1259040 - fix compiler warning at nsMsgMaildirStore.cpp:66 related to const unsigned cast. r=BenC
mailnews/local/src/nsMsgMaildirStore.cpp
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -49,26 +49,26 @@ static mozilla::LazyLogModule MailDirLog
 // safely encoded as individual bytes.
 static void percentEncode(nsACString const& in, nsACString& out)
 {
   const char* end = in.EndReading();
   const char* cur;
   // We know the output will be at least as long as the input.
   out.SetLength(0);
   out.SetCapacity(in.Length());
-  for (cur = in.BeginReading(); cur != end; ++cur) {
+  for (cur = in.BeginReading(); cur < end; ++cur) {
     const char c = *cur;
     bool whitelisted = (c >= '0' && c <= '9') ||
       (c >= 'A' && c <= 'Z') ||
       (c >= 'a' && c <= 'z') ||
       c == '-' || c == '+' || c == '.' || c == '%' || c == '=' || c == '@' || c == '_';
     if (whitelisted) {
       out.Append(c);
     } else {
-      out.AppendPrintf("%%%02x", (const unsigned char)c);
+      out.AppendPrintf("%%%02x", (unsigned char)c);
     }
   }
 }
 
 nsMsgMaildirStore::nsMsgMaildirStore()
 {
 }