diff options
author | SangYoun Kwak <sy.kwak@samsung.com> | 2022-03-22 11:40:21 +0900 |
---|---|---|
committer | SangYoun Kwak <sy.kwak@samsung.com> | 2022-03-22 11:58:19 +0900 |
commit | f1c8ff1386625f9f7cfcbe386508ff7a6df868f4 (patch) | |
tree | 59f2f775d0447ab6ee8f21b2d96d54913b8b8e53 | |
parent | 14039a4950f28b6accf8bd5d2479b31dc09816fa (diff) | |
download | libtota-f1c8ff1386625f9f7cfcbe386508ff7a6df868f4.tar.gz libtota-f1c8ff1386625f9f7cfcbe386508ff7a6df868f4.tar.bz2 libtota-f1c8ff1386625f9f7cfcbe386508ff7a6df868f4.zip |
Fix string length check and log printing
Change-Id: I91a259ef431a8378a177dc2ca9b1114bb5b9cfd9
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
-rwxr-xr-x | ss_engine/SS_FSUpdate.c | 6 |
1 files 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; |