bakaid commented on a change in pull request #672: MINIFICPP-1043 - FetchOPC 
should support reporting changes only
URL: https://github.com/apache/nifi-minifi-cpp/pull/672#discussion_r342461323
 
 

 ##########
 File path: extensions/opc/src/opc.cpp
 ##########
 @@ -548,9 +569,9 @@ std::string OPCDateTime2String(UA_DateTime raw_date) {
   UA_DateTimeStruct dts = UA_DateTime_toStruct(raw_date);
   std::array<char, 100> charBuf;
 
-  snprintf(charBuf.data(), charBuf.size(), "%02hu-%02hu-%04hu 
%02hu:%02hu:%02hu.%03hu", dts.day, dts.month, dts.year, dts.hour, dts.min, 
dts.sec, dts.milliSec);
+  int sz = snprintf(charBuf.data(), charBuf.size(), "%02hu-%02hu-%04hu 
%02hu:%02hu:%02hu.%03hu", dts.day, dts.month, dts.year, dts.hour, dts.min, 
dts.sec, dts.milliSec);
 
-  return std::string(charBuf.data(), charBuf.size());
+  return std::string(charBuf.data(), sz);
 
 Review comment:
   Nice catch!

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


With regards,
Apache Git Services

Reply via email to