X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fresource.c;h=2d98c905848362dc81893a39ee20fb44c2a4d3b3;hb=bb980160a4e612af0e46b4b69f06acd7b4adffe2;hp=24526a8310370a443b7c838b43ae4805a8098c0d;hpb=b79d426cd90c506974f6c956a9af141b5d257d42;p=wimlib diff --git a/src/resource.c b/src/resource.c index 24526a83..2d98c905 100644 --- a/src/resource.c +++ b/src/resource.c @@ -1095,13 +1095,6 @@ hasher_consume_chunk(const void *chunk, size_t size, void *_ctx) return (*ctx->cbs.consume_chunk)(chunk, size, ctx->cbs.consume_chunk_ctx); } -static void -get_sha1_string(const u8 md[SHA1_HASH_SIZE], tchar *str) -{ - for (size_t i = 0; i < SHA1_HASH_SIZE; i++) - str += tsprintf(str, T("%02x"), md[i]); -} - /* Callback for finishing reading a stream while calculating its SHA1 message * digest. */ static int @@ -1136,8 +1129,8 @@ hasher_end_stream(struct wim_lookup_table_entry *lte, int status, void *_ctx) if (wimlib_print_errors) { tchar expected_hashstr[SHA1_HASH_SIZE * 2 + 1]; tchar actual_hashstr[SHA1_HASH_SIZE * 2 + 1]; - get_sha1_string(lte->hash, expected_hashstr); - get_sha1_string(hash, actual_hashstr); + sprint_hash(lte->hash, expected_hashstr); + sprint_hash(hash, actual_hashstr); ERROR("The stream is corrupted!\n" " (Expected SHA1=%"TS",\n" " got SHA1=%"TS")", @@ -1436,7 +1429,7 @@ extract_stream(struct wim_lookup_table_entry *lte, u64 size, /* A consume_data_callback_t implementation that writes the chunk of data to a * file descriptor. */ -int +static int extract_chunk_to_fd(const void *chunk, size_t size, void *_fd_p) { struct filedes *fd = _fd_p;