bakaid commented on a change in pull request #604: MINIFICPP-926 Create nanofi
tailfile processor for tailing file by configurable chunk size
URL: https://github.com/apache/nifi-minifi-cpp/pull/604#discussion_r300618991
##########
File path: nanofi/src/api/nanofi.cpp
##########
@@ -263,10 +263,9 @@ flow_file_record * generate_flow_file(nifi_instance *
instance, standalone_proce
ffr->keepContent = 1;
auto ff_content_repo_ptr =
(static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(ffr->crp));
auto claim = std::make_shared<minifi::ResourceClaim>(*ff_content_repo_ptr);
- const char * full_path = claim->getContentFullPath().c_str();
- int len = strlen(full_path);
- ffr->contentLocation = (char *) malloc(sizeof(char) * (len + 1));
- snprintf(ffr->contentLocation, len + 1, "%s", full_path);
+ int len = strlen(claim->getContentFullPath().c_str());
Review comment:
What is the purpose of this change?
snprintf will append a terminating null character, there is no need to use
calloc instead of malloc, and I see no other substantive change in this.
----------------------------------------------------------------
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