From 3e85a8e6db1a9c9a7fcf7974a1a0307b2cb145bd Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 19 Oct 2025 20:03:22 +0200 Subject: strops and memops refactor --- src/importer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/importer.cpp') diff --git a/src/importer.cpp b/src/importer.cpp index ae8bada..194913a 100644 --- a/src/importer.cpp +++ b/src/importer.cpp @@ -61,7 +61,7 @@ static int _ai_document_to_invoice_t(void *arg) { char* template_buffer = (char*)memops::alloc(query_buffer_len); memops::zero(template_buffer, query_buffer_len); - strncpy(template_buffer, file_template::peppol_invoice_template, query_buffer_len); + strops::copy(template_buffer, file_template::peppol_invoice_template, query_buffer_len); strops::replace(template_buffer, 50000, "{{INVOICE_LINE_LIST}}", file_template::peppol_invoice_line_template); char* ai_query = @@ -93,8 +93,8 @@ static int _ai_document_to_invoice_t(void *arg) { "cac:Delivery contains the delivery address for physical goods. This information might be under the section 'Shipping address', 'Shipped to' or something similar. If this is not explicitly set, leave this section empty.\n" ; - size_t query_len = strlen(template_buffer); - strncpy(template_buffer + query_len, ai_query, query_buffer_len - query_len); + size_t query_len = strops::length(template_buffer); + strops::copy(template_buffer + query_len, ai_query, query_buffer_len - query_len); request->status = importer::status::IMPORT_WAITING_FOR_RESPONSE; @@ -106,7 +106,7 @@ static int _ai_document_to_invoice_t(void *arg) { } invoice inv; - if (!administration_reader::read_invoice_from_xml(&inv, response, strlen(response))) { + if (!administration_reader::read_invoice_from_xml(&inv, response, strops::length(response))) { request->status = importer::status::IMPORT_DONE; request->error = I_ERR_FAILED_IMPORT; return 0; -- cgit v1.2.3-70-g09d2