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 authored and Lane.Wei committed 2023-11-01 09:33:21 +08:00
1 parent 9aed4e9273
commit ec8d681981
2 files changed
+23 -13

No files matched your search

+1 -1
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;