From d42dcde4babff079a488ea5fd0e033b5a5f7801c Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Fri, 17 May 2024 10:56:59 +0900 Subject: [PATCH] Reuse pm_buffer_append function in pm_buffer_append_zeroes --- src/util/pm_buffer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/pm_buffer.c b/src/util/pm_buffer.c index 1e79e46718c..5171c5bb3be 100644 --- a/src/util/pm_buffer.c +++ b/src/util/pm_buffer.c @@ -84,10 +84,8 @@ pm_buffer_append(pm_buffer_t *buffer, const void *source, size_t length) { */ void pm_buffer_append_zeroes(pm_buffer_t *buffer, size_t length) { - size_t cursor = buffer->length; - if (pm_buffer_append_length(buffer, length)) { - memset(buffer->value + cursor, 0, length); - } + size_t source = 0; + pm_buffer_append(buffer, (const void *) source, length); } /**