Fix string length check and log printing
[platform/core/system/libtota.git] / ss_engine / SS_FSUpdate.c
index 8cc8250..1126859 100755 (executable)
@@ -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;