You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/01/31 23:37:29 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a change in pull request #8638: Trim white spaces before and after the equal sign

SolidWallOfCode commented on a change in pull request #8638:
URL: https://github.com/apache/trafficserver/pull/8638#discussion_r796156658



##########
File path: plugins/s3_auth/aws_auth_v4.cc
##########
@@ -176,39 +176,38 @@ canonicalEncode(const String &in, bool isObjectName)
  * @param inLen input character count
  * @return pointer to the trimmed string.
  */
-std::string
+String
 trimWhiteSpacesAndSqueezeInnerSpaces(const char *in, size_t inLen)
 {
-  if (nullptr == in || inLen == 0) {
-    return std::string(in, inLen);
-  }
+  String in_str = String(in, inLen);

Review comment:
       Won't this crash if `in == nullptr`? Put a unit test in for that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org