aboutsummaryrefslogtreecommitdiff
path: root/c_implementation/src/akfs_map_v3.c
diff options
context:
space:
mode:
Diffstat (limited to 'c_implementation/src/akfs_map_v3.c')
-rw-r--r--c_implementation/src/akfs_map_v3.c23
1 files changed, 12 insertions, 11 deletions
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);