SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] %s is real file, not symbolic link", path);
*is_symbolic = false;
} else {
+ char current_working_directory[PATH_MAX];
char temp_path[PATH_MAX];
- if (getcwd(temp_path, PATH_MAX)) {
- strncat(temp_path, "/", sizeof(temp_path) - strlen(temp_path) - 1);
- strncat(temp_path, path, sizeof(temp_path) - strlen(temp_path) - 1);
+ if (getcwd(current_working_directory, PATH_MAX)) {
+ snprintf(temp_path, PATH_MAX, "%s/%s", current_working_directory, path);
if (strncmp(temp_path, real_path, strlen(temp_path) + 1) == 0) {
SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] %s is real file, not symbolic link", path);
*is_symbolic = false;