From f1c8ff1386625f9f7cfcbe386508ff7a6df868f4 Mon Sep 17 00:00:00 2001 From: SangYoun Kwak Date: Tue, 22 Mar 2022 11:40:21 +0900 Subject: Fix string length check and log printing Change-Id: I91a259ef431a8378a177dc2ca9b1114bb5b9cfd9 Signed-off-by: SangYoun Kwak --- ss_engine/SS_FSUpdate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ss_engine/SS_FSUpdate.c b/ss_engine/SS_FSUpdate.c index 8cc8250..1126859 100755 --- a/ss_engine/SS_FSUpdate.c +++ b/ss_engine/SS_FSUpdate.c @@ -134,12 +134,12 @@ long SS_recursive_folder_creater(const char *path, const mode_t mode) { int mkd_res = mkdir(temppath, mode); if(mkd_res != 0 && errno != EEXIST) { - LOGL(LOG_SSENGINE,"cannot create dir %s\n system error: %d error: %s\n", temppath, errno, strerror(errno)); + LOGL(LOG_SSENGINE,"cannot create dir %s\n system error: %d error: %m\n", temppath, errno); return -E_SS_CANNOT_CREATE_DIRECTORY; } - if(path_token_len < (MAX_PATH-1)) { - strcat(temppath, "/"); + if(temppath_current_len < (MAX_PATH-1)) { + strncat(temppath, "/", 2); } } return 0; -- cgit v1.2.3