From 32d656ceedf8b6f8f49597b484197f09d6c85599 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 14 Jan 2025 12:12:35 +0100 Subject: [PATCH] html: default string lengths in document::assign/append We run a strnlen before processing anyway. Signed-off-by: Simon Rozman --- include/stdex/html.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/stdex/html.hpp b/include/stdex/html.hpp index d9fae66b9..a6c7c8cdf 100644 --- a/include/stdex/html.hpp +++ b/include/stdex/html.hpp @@ -1654,7 +1654,7 @@ namespace stdex /// /// Parses HTML source code by chunks /// - void append(_In_reads_or_z_opt_(num_chars) const T* source, _In_ size_t num_chars) + void append(_In_reads_or_z_opt_(num_chars) const T* source, _In_ size_t num_chars = SIZE_MAX) { stdex_assert(source || !num_chars); m_source.append(source, stdex::strnlen(source, num_chars)); @@ -1878,7 +1878,7 @@ namespace stdex /// /// Parses HTML document source code /// - void assign(_In_reads_or_z_opt_(num_chars) const T* source, _In_ size_t num_chars) + void assign(_In_reads_or_z_opt_(num_chars) const T* source, _In_ size_t num_chars = SIZE_MAX) { clear(); append(source, num_chars); @@ -2136,7 +2136,7 @@ namespace stdex }; /// - /// HTTP token representing an URL + /// HTML token representing an URL /// template, class AX = std::allocator> class url_token : public token