Bug 1399627 - Follow-up: add comment. rs=comment-only DONTBUILD
authorJorg K <jorgk@jorgk.com>
Tue, 03 Oct 2017 12:41:19 +0200
changeset 29095 cf664b8070cfdbd52bc514e14d6d3dc5e13dcb03
parent 29094 c6fafa3db46a7205307a0579b5d663192f46600f
child 29096 9c2aabee10e9843d37133ae60843602384b73f75
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscomment-only
bugs1399627
Bug 1399627 - Follow-up: add comment. rs=comment-only DONTBUILD
mailnews/compose/src/nsSmtpProtocol.cpp
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -111,20 +111,25 @@ nsresult nsExplainErrorDetails(nsISmtpUr
     case NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2:
     case NS_ERROR_SENDING_FROM_COMMAND:
     case NS_ERROR_SENDING_RCPT_COMMAND:
     case NS_ERROR_SENDING_DATA_COMMAND:
     case NS_ERROR_SENDING_MESSAGE:
     case NS_ERROR_SMTP_GREETING:
       exitString = errorStringNameForErrorCode(aCode);
       bundle->GetStringFromName(exitString, eMsg);
-      if (aCode == NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_1)
+      if (aCode == NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_1) {
+        // Convert the error message argument back to integer since the error
+        // message string smtpPermSizeExceeded1 contains a %d.
+        // (The special case can be removed if that string ever changes, then
+        // %d should be changed to %S.)
         nsTextFormatter::ssprintf(msg, eMsg.get(), atoi(arg1), arg2);
-      else
+      } else {
         nsTextFormatter::ssprintf(msg, eMsg.get(), arg1, arg2);
+      }
       break;
     default:
       NS_WARNING("falling to default error code");
       bundle->GetStringFromName("communicationsError", eMsg);
       nsTextFormatter::ssprintf(msg, eMsg.get(), static_cast<uint32_t>(aCode));
       break;
   }
 #ifdef __GNUC__