diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-03-28 17:13:34 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-03-28 17:13:34 +0200 |
commit | 24142c94ca1fe2c350172e529d0ac9b4001e9307 (patch) | |
tree | e9b438be202f3f99b494b9a153cdb9cec181bece /src/akfs.c | |
parent | 50502ec2b41733ba5f152cbde457f6cb66e588c6 (diff) | |
download | arching-kaos-tools-24142c94ca1fe2c350172e529d0ac9b4001e9307.tar.gz arching-kaos-tools-24142c94ca1fe2c350172e529d0ac9b4001e9307.tar.bz2 arching-kaos-tools-24142c94ca1fe2c350172e529d0ac9b4001e9307.zip |
Avoiding malloc/free combo by providing a pointer to the function
Diffstat (limited to 'src/akfs.c')
-rw-r--r-- | src/akfs.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -258,9 +258,8 @@ sha512sum ak_fs_sha512sum_string_to_struct(char* string) } } -char* ak_fs_sha512sum_struct_to_string(sha512sum hash) +void ak_fs_sha512sum_struct_to_string(sha512sum hash, char* string) { - char *string = malloc(129); int counter = 0; for (size_t i = 0; i < 8; ++i) { @@ -324,5 +323,4 @@ char* ak_fs_sha512sum_struct_to_string(sha512sum hash) } } string[128] = '\0'; - return string; } |