revamp-strings (#1)

Co-authored-by: Abdelrahman Said <said.abdelrahman@flawlessai.com>
Reviewed-on: #1
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit is contained in:
2024-10-07 22:35:56 +00:00
committed by Abdelrahman Said
parent 40d301fd95
commit 685682e1c8
10 changed files with 94 additions and 303 deletions

View File

@@ -47,7 +47,7 @@ void dirup(char *dst, u64 levels, const char *path) {
}
char tmp[256];
sprintf(tmp, "%c", PATH_SEP);
snprintf(tmp, 2, "%c", PATH_SEP);
// NOTE (Abdelrahman): Conditions stored in variables to silence MSVC warning C5045
bool insufficient_levels = sep_count < levels;
bool path_to_copy_is_separator = strncmp(path, tmp, copy_count) != 0;