1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-27 22:24:28 +01:00

Codechange: Use std::span/std::string_view for strecpy. (#12848)

This avoids needing to manually pass the last character of the destination buffer, and allows use of standard library functions.
This commit is contained in:
Peter Nelson
2024-07-09 00:05:42 +01:00
committed by GitHub
parent 86e32631d7
commit 56b0eac2e9
4 changed files with 21 additions and 28 deletions

View File

@@ -17,7 +17,7 @@
#include "core/bitmath_func.hpp"
#include "string_type.h"
char *strecpy(char *dst, const char *src, const char *last) NOACCESS(3);
void strecpy(std::span<char> dst, std::string_view src);
std::string FormatArrayAsHex(std::span<const uint8_t> data);