head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2026.07.24.12.15.52; author adam; state Exp; branches; next ; commitid ajeEDfEvck0P2UOG; desc @@ 1.1 log @poco: updated to 1.15.3 1.15.3 Bug fixes, expat CVE updates in bundled deps, MongoDB 6.0/7.0/8.0 compatibility, PostgreSQL URI connection strings, and a corrected %c date/time format specifier (breaking). @ text @$NetBSD$ Support systems without strnlen(). --- Foundation/src/BinaryWriter.cpp.orig 2026-07-24 09:36:03.931372107 +0000 +++ Foundation/src/BinaryWriter.cpp @@@@ -333,10 +333,18 @@@@ void BinaryWriter::writeRaw(const char* _ostr.write(buffer, length); } +#ifndef strnlen +static std::size_t strnlen(const char* s, std::size_t maxLength) +{ + std::size_t i = 0; + while (i < maxLength && s[i] != '\0') ++i; + return i; +} +#endif void BinaryWriter::writeCString(const char* cString, std::streamsize maxLength) { - const std::size_t len = ::strnlen(cString, static_cast(maxLength)); + const std::size_t len = strnlen(cString, static_cast(maxLength)); writeRaw(cString, len); static const char zero = '\0'; _ostr.write(&zero, sizeof(zero)); @