fgerlits commented on a change in pull request #1103:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1103#discussion_r651809759



##########
File path: extensions/opc/src/opc.cpp
##########
@@ -572,7 +574,7 @@ std::string OPCDateTime2String(UA_DateTime raw_date) {
 
 void logFunc(void *context, UA_LogLevel level, UA_LogCategory /*category*/, 
const char *msg, va_list args) {
   char buffer[1024];
-  vsnprintf(buffer, 1024, msg, args);
+  vsnprintf(buffer, sizeof(buffer), msg, args);

Review comment:
       it's `sizeof(type)` and `sizeof expression` according to 
https://en.cppreference.com/w/cpp/language/sizeof (although we don't follow 
this consistently in the rest of the code)
   ```suggestion
     vsnprintf(buffer, sizeof buffer, msg, args);
   ```




-- 
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]


Reply via email to