Skip to content

Commit

Permalink
Codechange: SetDParamStr borrows contents from std::string::c_str(). …
Browse files Browse the repository at this point in the history
…Prevent calling it with temporaries. (#10136)
  • Loading branch information
frosch123 committed Nov 5, 2022
1 parent 21cea30 commit fea6a34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/strings_func.h
Expand Up @@ -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);
Expand Down

0 comments on commit fea6a34

Please sign in to comment.