ENH: 3mf: improve some logic

1. skip file including /../
2. use snprintf instead of sprintf

JIRA: jira-xxxx
Change-Id: I6695dc11f9f4af4318038e6db5c219fd14e73aef
This commit is contained in:
lane.wei 2023-09-21 08:53:51 +08:00 committed by Lane.Wei
parent 9d12c73aee
commit 805248f38a
2 changed files with 23 additions and 13 deletions

View file

@ -219,7 +219,7 @@ typedef struct _cli_callback_mgr {
//notify_message = "Plate "+ std::to_string(m_plate_index) + "/" +std::to_string(m_plate_count)+ ": Percent " + std::to_string(m_progress) + ": "+m_message;
char pipe_message[PIPE_BUFFER_SIZE] = {0};
sprintf(pipe_message, "%s\n", notify_message.c_str());
snprintf(pipe_message, PIPE_BUFFER_SIZE, "%s\n", notify_message.c_str());
int ret = write(m_pipe_fd, pipe_message, strlen(pipe_message));
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ": write returns "<<ret;