From 5d0152e151c7731b99af51744fc5dab03cad6cd4 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 25 Apr 2025 00:07:58 +0300 Subject: [libakfs] Updates --- c_implementation/src/akfs_map_v3.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'c_implementation/src/akfs_map_v3.c') diff --git a/c_implementation/src/akfs_map_v3.c b/c_implementation/src/akfs_map_v3.c index 7b7e75b..0eb1ea1 100644 --- a/c_implementation/src/akfs_map_v3.c +++ b/c_implementation/src/akfs_map_v3.c @@ -27,9 +27,9 @@ void ak_fs_map_v3_print_original_hash(akfs_map_v3 *map) { if (!ak_fs_map_v3_is_null(map)) { - char string[129]; - ak_fs_sha512sum_struct_to_string(&(map->oh), string); - printf(" .oh: %s\n", string); + char str[129]; + ak_fs_sha512sum_struct_to_string(&(map->oh), str); + printf(" .oh: %s\n", str); } else { @@ -41,9 +41,9 @@ void ak_fs_map_v3_print_root_hash(akfs_map_v3 *map) { if (!ak_fs_map_v3_is_null(map)) { - char string[129]; - ak_fs_sha512sum_struct_to_string(&(map->rh), string); - printf(" .rh: %s\n", string ); + char str[129]; + ak_fs_sha512sum_struct_to_string(&(map->rh), str); + printf(" .rh: %s\n", str ); } else { @@ -67,7 +67,7 @@ void ak_fs_map_v3_print_filename(akfs_map_v3 *map) { if (!ak_fs_map_v3_is_null(map)) { - printf(" .fn: %s\n", ak_fs_map_v3_get_filename(map)); + printf("%s\n", ak_fs_map_v3_get_filename(map)); } } @@ -75,9 +75,9 @@ void ak_fs_map_v3_print_map_hash(akfs_map_v3 *map) { if (!ak_fs_map_v3_is_null(map)) { - char string[129]; - ak_fs_sha512sum_struct_to_string(&(map->mh), string); - printf(" .mh: %s\n", string ); + char str[129]; + ak_fs_sha512sum_struct_to_string(&(map->mh), str); + printf(" .mh: %s\n", str ); } } @@ -93,7 +93,7 @@ void ak_fs_map_v3_print(akfs_map_v3 *map) int ak_fs_open_map_v3_file(char* maphash, akfs_map_v3 * map) { - if (map==0x0||map==NULL) + if (map==0x0) { ak_log_debug(__func__, "Zeropointer"); return 1; @@ -116,6 +116,7 @@ int ak_fs_open_map_v3_file(char* maphash, akfs_map_v3 * map) struct stat sb; if (stat(full_path, &sb) == -1) { perror("stat"); + fclose(fd); return 2; } // File size: %lld in bytes: (long long) sb.st_size); -- cgit v1.2.3