Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/636#discussion_r63215421
  
    --- Diff: proxy/http/HttpTransact.cc ---
    @@ -3460,7 +3460,7 @@ HttpTransact::HandleStatPage(State *s)
           s->hdr_info.client_response.value_set(MIME_FIELD_CONTENT_TYPE, 
MIME_LEN_CONTENT_TYPE, s->internal_msg_buffer_type, len);
         }
       } else {
    -    s->hdr_info.client_response.value_set(MIME_FIELD_CONTENT_TYPE, 
MIME_LEN_CONTENT_TYPE, "text/plain", 9);
    +    s->hdr_info.client_response.value_set(MIME_FIELD_CONTENT_TYPE, 
MIME_LEN_CONTENT_TYPE, "text/plain", 10);
    --- End diff --
    
    Maybe clang-tidy can do it? Or it is possible to write a custom check?
    
    I often use a ``lengthof`` template to do the static strlen:
    
    ```C
    template <unsigned>
    size_t lengthof(const char (&)[N]) {
        return N - 1;
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to