From 68d6804a43dca2749a68a557e67b98e6005ead83 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 15 May 2026 01:22:19 +0200 Subject: Fix some minor issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- librecrypt_add_algorithm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'librecrypt_add_algorithm.c') diff --git a/librecrypt_add_algorithm.c b/librecrypt_add_algorithm.c index 920577d..4c6520e 100644 --- a/librecrypt_add_algorithm.c +++ b/librecrypt_add_algorithm.c @@ -67,8 +67,15 @@ librecrypt_add_algorithm(char *out_buffer, size_t size, const char *augend, cons out_buffer[0u] = '\0'; } } else { +#if defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif if (!hashsize2) goto out; +#if defined(__GNUC__) +# pragma GCC diagnostic pop +#endif r_int = snprintf(NULL, 0u, "*%zu", hashsize2); if (r_int < 2) abort(); /* $covered$ (impossible reliably) */ @@ -126,7 +133,7 @@ librecrypt_add_algorithm(char *out_buffer, size_t size, const char *augend, cons /* Chain the hash algorithms: write `augent` */ min = MIN(prefix1, size); - if (out_buffer != augend) + if (out_buffer != augend && min) memmove(out_buffer, augend, min); out_buffer = &out_buffer[min]; size -= min; -- cgit v1.2.3-70-g09d2