diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-18 08:58:32 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-18 08:58:32 +0200 |
| commit | 0dc33a4dd49eb560e98b24090969fd618a4c6198 (patch) | |
| tree | 77e7070bcbbcc9db4e0c5552ae83a33d3b2f9cfc /src/administration_writer.cpp | |
| parent | c1d950f2765cde614c8411b4effb3850146ba598 (diff) | |
refactor memops
Diffstat (limited to 'src/administration_writer.cpp')
| -rw-r--r-- | src/administration_writer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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++) |
