3 커밋 8d752f372c ... 59cc3be1cd

작성자 SHA1 메시지 날짜
  Jens Keim 59cc3be1cd Merge branch 'cpp_warnings' of stefan.schmidt/ID2T-toolkit into master 6 년 전
  Stefan Schmidt 564eb657dd Fixed format string truncation warning in statistics.cpp 6 년 전
  Stefan Schmidt 8ebd777723 Fixed comparison warning in botnet_comm_processor.cpp 6 년 전
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      code_boost/src/cxx/botnet_comm_processor.cpp
  2. 1 1
      code_boost/src/cxx/statistics.cpp

+ 1 - 1
code_boost/src/cxx/botnet_comm_processor.cpp

@@ -26,7 +26,7 @@ botnet_comm_processor::botnet_comm_processor(){
  */
 void botnet_comm_processor::set_messages(const py::list &messages_pyboost){
     messages.clear();
-    for (int i = 0; i < len(messages_pyboost); i++){
+    for (size_t i = 0; i < len(messages_pyboost); i++){
         py::dict msg_pyboost = py::cast<py::dict>(messages_pyboost[i]);
         unsigned int src_id = std::stoi(py::cast<std::string>(msg_pyboost["Src"]));
         unsigned int dst_id = std::stoi(py::cast<std::string>(msg_pyboost["Dst"]));

+ 1 - 1
code_boost/src/cxx/statistics.cpp

@@ -666,7 +666,7 @@ std::string statistics::getFormattedTimestamp(time_t seconds, suseconds_t micros
     timeval tv;
     tv.tv_sec = seconds;
     tv.tv_usec = microseconds;
-    char tmbuf[64], buf[64];
+    char tmbuf[20], buf[64];
     auto nowtm = gmtime(&(tv.tv_sec));
     strftime(tmbuf, sizeof(tmbuf), "%Y-%m-%d %H:%M:%S", nowtm);
     snprintf(buf, sizeof(buf), "%s.%06u", tmbuf, static_cast<uint>(tv.tv_usec));