]> git.seodisparate.com - SimpleArchiver/commitdiff
Cleanup related to change of hash-map insert fn
authorStephen Seo <seo.disparate@gmail.com>
Mon, 9 Sep 2024 08:10:17 +0000 (17:10 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Mon, 9 Sep 2024 08:10:17 +0000 (17:10 +0900)
src/archiver.c

index b83fd911077da455161a9a1152c0ae5a504ebc40..9b20e6f24cff6901c6d1b605e4cb49bc24fd7376 100644 (file)
@@ -909,7 +909,7 @@ int write_files_fn(void *data, void *ud) {
 int filenames_to_abs_map_fn(void *data, void *ud) {
   SDArchiverFileInfo *file_info = data;
   void **ptr_array = ud;
-  SDArchiverHashMap **abs_filenames = ptr_array[0];
+  SDArchiverHashMap *abs_filenames = ptr_array[0];
   const char *user_cwd = ptr_array[1];
   __attribute__((cleanup(
       simple_archiver_helper_cleanup_chdir_back))) char *original_cwd = NULL;
@@ -931,7 +931,7 @@ int filenames_to_abs_map_fn(void *data, void *ud) {
   }
 
   simple_archiver_hash_map_insert(
-      *abs_filenames, fullpath, fullpath, strlen(fullpath) + 1,
+      abs_filenames, fullpath, fullpath, strlen(fullpath) + 1,
       simple_archiver_helper_datastructure_cleanup_nop, NULL);
 
   // Try putting all parent dirs up to current working directory.
@@ -967,7 +967,7 @@ int filenames_to_abs_map_fn(void *data, void *ud) {
       strncpy(fullpath_dirname_copy, fullpath_dirname,
               strlen(fullpath_dirname) + 1);
       simple_archiver_hash_map_insert(
-          *abs_filenames, fullpath_dirname_copy, fullpath_dirname_copy,
+          abs_filenames, fullpath_dirname_copy, fullpath_dirname_copy,
           strlen(fullpath_dirname_copy) + 1,
           simple_archiver_helper_datastructure_cleanup_nop, NULL);
     }
@@ -1036,7 +1036,7 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
   __attribute__((cleanup(simple_archiver_hash_map_free)))
   SDArchiverHashMap *abs_filenames = simple_archiver_hash_map_init();
   void **ptr_array = malloc(sizeof(void *) * 2);
-  ptr_array[0] = &abs_filenames;
+  ptr_array[0] = abs_filenames;
   ptr_array[1] = (void *)state->parsed->user_cwd;
   if (simple_archiver_list_get(filenames, filenames_to_abs_map_fn, ptr_array)) {
     free(ptr_array);