Fix release build compiler warnings
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 6s
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 6s
This commit is contained in:
parent
302f7f804d
commit
b1745172f7
1 changed files with 11 additions and 9 deletions
|
@ -2734,7 +2734,7 @@ int simple_archiver_parse_archive_version_0(FILE *in_f, int_fast8_t do_extract,
|
||||||
int_fast8_t write_again = 0;
|
int_fast8_t write_again = 0;
|
||||||
int_fast8_t write_pipe_done = 0;
|
int_fast8_t write_pipe_done = 0;
|
||||||
int_fast8_t read_pipe_done = 0;
|
int_fast8_t read_pipe_done = 0;
|
||||||
size_t fread_ret;
|
size_t fread_ret = 0;
|
||||||
char recv_buf[1024];
|
char recv_buf[1024];
|
||||||
size_t amount_to_read;
|
size_t amount_to_read;
|
||||||
while (!write_pipe_done || !read_pipe_done) {
|
while (!write_pipe_done || !read_pipe_done) {
|
||||||
|
@ -3933,11 +3933,12 @@ char *simple_archiver_filenames_to_relative_path(const char *from_abs,
|
||||||
has_slash = 0;
|
has_slash = 0;
|
||||||
} else {
|
} else {
|
||||||
has_slash = 1;
|
has_slash = 1;
|
||||||
char *new_rel_path = malloc(strlen(rel_path) + 1 + 3);
|
size_t new_rel_path_size = strlen(rel_path) + 1 + 3;
|
||||||
|
char *new_rel_path = malloc(new_rel_path_size);
|
||||||
new_rel_path[0] = '.';
|
new_rel_path[0] = '.';
|
||||||
new_rel_path[1] = '.';
|
new_rel_path[1] = '.';
|
||||||
new_rel_path[2] = '/';
|
new_rel_path[2] = '/';
|
||||||
strncpy(new_rel_path + 3, rel_path, strlen(rel_path) + 1);
|
strncpy(new_rel_path + 3, rel_path, new_rel_path_size - 3);
|
||||||
free(rel_path);
|
free(rel_path);
|
||||||
rel_path = new_rel_path;
|
rel_path = new_rel_path;
|
||||||
++idx;
|
++idx;
|
||||||
|
@ -3978,12 +3979,13 @@ char *simple_archiver_file_abs_path(const char *filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get combined full path to file.
|
// Get combined full path to file.
|
||||||
char *fullpath =
|
const size_t realpath_size = strlen(dir_realpath) + 1;
|
||||||
malloc(strlen(dir_realpath) + 1 + strlen(filename_basename) + 1);
|
const size_t basename_size = strlen(filename_basename) + 1;
|
||||||
strncpy(fullpath, dir_realpath, strlen(dir_realpath) + 1);
|
const size_t fullpath_size = realpath_size + basename_size;
|
||||||
fullpath[strlen(dir_realpath)] = '/';
|
char *fullpath = malloc(fullpath_size);
|
||||||
strncpy(fullpath + strlen(dir_realpath) + 1, filename_basename,
|
strncpy(fullpath, dir_realpath, realpath_size);
|
||||||
strlen(filename_basename) + 1);
|
fullpath[realpath_size - 1] = '/';
|
||||||
|
strcpy(fullpath + realpath_size, filename_basename);
|
||||||
|
|
||||||
return fullpath;
|
return fullpath;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue