From 0dc33a4dd49eb560e98b24090969fd618a4c6198 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 18 Oct 2025 08:58:32 +0200 Subject: refactor memops --- src/administration_writer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/administration_writer.cpp') diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp index 5010dd8..6b28367 100644 --- a/src/administration_writer.cpp +++ b/src/administration_writer.cpp @@ -93,7 +93,7 @@ static char* copy_template(const char* template_str, int* buf_size) size_t template_size = strlen(template_str); size_t buf_length = template_size*5; // Ballpark file content size. char* file_content = (char*)memops::alloc(buf_length); - memset(file_content, 0, buf_length); + memops::zero(file_content, buf_length); memops::copy(file_content, template_str, template_size); *buf_size = (int)buf_length; return file_content; @@ -334,7 +334,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) bool result = 1; int buf_length = 150000; // Ballpark file content size. char* file_content = (char*)memops::alloc(buf_length); - memset(file_content, 0, buf_length); + memops::zero(file_content, buf_length); memops::copy(file_content, file_template::peppol_invoice_template, strlen(file_template::peppol_invoice_template)); struct tm *tm_info = 0; @@ -412,7 +412,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) u32 tax_subtotal_list_buffer_size = (u32)strlen(file_template::peppol_invoice_tax_subtotal_template) * 2 * tax_rate_count; // Ballpark list size. char* tax_subtotal_list_buffer = (char*)memops::alloc(tax_subtotal_list_buffer_size); - memset(tax_subtotal_list_buffer, 0, tax_subtotal_list_buffer_size); + memops::zero(tax_subtotal_list_buffer, tax_subtotal_list_buffer_size); u32 tax_subtotal_list_buffer_cursor = 0; for (u32 i = 0; i < tax_rate_count; i++) @@ -460,7 +460,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) u32 billing_item_list_buffer_size = (u32)strlen(file_template::peppol_invoice_line_template) * 2 * billing_item_count; // Ballpark list size. char* billing_item_list_buffer = (char*)memops::alloc(billing_item_list_buffer_size); - memset(billing_item_list_buffer, 0, billing_item_list_buffer_size); + memops::zero(billing_item_list_buffer, billing_item_list_buffer_size); u32 billing_item_list_buffer_cursor = 0; for (u32 i = 0; i < billing_item_count; i++) -- cgit v1.2.3-70-g09d2