freak82 commented on PR #11382:
URL: https://github.com/apache/trafficserver/pull/11382#issuecomment-2126298815

   Updated the pull request.
   
   Overall the situation with this "maybe-negative-length" pattern is a bit 
confusing (at least for me).
   I mean, if there this usage:
   ```
   void some_exported_API(const char* str, int len)
   {
     internal_fun_1(str, len);
     
     internal_fun_2(str, len);
     
     internal_fun_3(str, len);
   }
   ```
   Is the check of `if (len < 0) len = strlen(str)` supposed to happen at the 
highest level i.e. in the `some_exported_API` or every internal function is 
supposed to have this check (but then the if-check or the call to `strlen` will 
be potentially repeated multiple times).
   Or the internal functions are just supposed to assert the `len >= 0`? But 
then why just don't get it as `size_t`.
   Anyhow, the these are just my thoughts. It's what it's.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to