int extension_len = 0;
int suffix_count = 0; /* means suffix on file name. up to "_99" */
- int suffix_len = (int)log10(MAX_SUFFIX_COUNT + 1) + 1; /* 1 means "_" */
+ int suffix_len = (int)log10(MAX_SUFFIX_COUNT + 1) + 2; /* 2 means "()" */
if (!in_dir || !in_candidate_file_name)
return DA_NULL;
"%s/%s", dir, file_name);
} else {
snprintf(final_path, final_path_len,
- "%s/%s_%d", dir, file_name, suffix_count);
+ "%s/%s(%d)", dir, file_name, suffix_count);
}
} else {
if (suffix_count == 0) {
"%s/%s.%s", dir, file_name, extension);
} else {
snprintf(final_path, final_path_len,
- "%s/%s_%d.%s",
+ "%s/%s(%d).%s",
dir, file_name, suffix_count, extension);
}
}