zwoop commented on issue #7151:
URL: https://github.com/apache/trafficserver/issues/7151#issuecomment-687897654
@thelounge-zz Can you try this patch for the ink_hrtime.cc bogus warning?
```
diff --git a/src/tscore/ink_hrtime.cc b/src/tscore/ink_hrtime.cc
index 9bffa1a53..201b63cab 100644
--- a/src/tscore/ink_hrtime.cc
+++ b/src/tscore/ink_hrtime.cc
@@ -49,7 +49,6 @@ int64_to_str(char *buf, unsigned int buf_size, int64_t
val, unsigned int *total_
char local_buf[local_buf_size];
bool using_local_buffer = false;
bool negative = false;
- char *out_buf = buf;
char *working_buf;
if (buf_size < 22) {
@@ -134,10 +133,9 @@ int64_to_str(char *buf, unsigned int buf_size, int64_t
val, unsigned int *total_
if (using_local_buffer) {
if (num_chars <= buf_size) {
memcpy(buf, working_buf, num_chars);
- // out_buf is already pointing to buf
} else {
- // data does not fit return nullptr
- out_buf = nullptr;
+ // data does not fit, return nullptr
+ buf = nullptr;
}
}
@@ -145,7 +143,7 @@ int64_to_str(char *buf, unsigned int buf_size, int64_t
val, unsigned int *total_
*total_chars = num_chars;
}
- return out_buf;
+ return buf;
}
int
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]