Преглед изворни кода

fix: %i in format string (no. 1) requires 'int' but the argument type is
'unsigned int'

Git-Dch: Ignore
Reported-By: cppcheck

David Kalnischkies пре 12 година
родитељ
комит
84361defb5
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      methods/server.cc

+ 3 - 3
methods/server.cc

@@ -324,10 +324,10 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
       failure */
       failure */
    if (Server->Result < 200 || Server->Result >= 300)
    if (Server->Result < 200 || Server->Result >= 300)
    {
    {
-      char err[255];
-      snprintf(err,sizeof(err)-1,"HttpError%i",Server->Result);
+      std::string err;
+      strprintf(err, "HttpError%u", Server->Result);
       SetFailReason(err);
       SetFailReason(err);
-      _error->Error("%u %s",Server->Result,Server->Code);
+      _error->Error("%u %s", Server->Result, Server->Code);
       if (Server->HaveContent == true)
       if (Server->HaveContent == true)
 	 return ERROR_WITH_CONTENT_PAGE;
 	 return ERROR_WITH_CONTENT_PAGE;
       return ERROR_UNRECOVERABLE;
       return ERROR_UNRECOVERABLE;