From fea6a346841aa2979ec2d4b7b5617fd616fe33c1 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 5 Nov 2022 17:14:10 +0100 Subject: [PATCH] Codechange: SetDParamStr borrows contents from std::string::c_str(). Prevent calling it with temporaries. (#10136) --- src/strings_func.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/strings_func.h b/src/strings_func.h index 9d41ecd28a..bdb4fc6cd6 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -203,6 +203,7 @@ void SetDParamMaxDigits(uint n, uint count, FontSize size = FS_NORMAL); void SetDParamStr(uint n, const char *str); void SetDParamStr(uint n, const std::string &str); +void SetDParamStr(uint n, std::string &&str) = delete; // block passing temporaries to SetDParamStr void CopyInDParam(int offs, const uint64 *src, int num); void CopyOutDParam(uint64 *dst, int offs, int num);