pytorch
621158cd - [BE] Do not assign string literal to `char *` (#87949)

Commit
3 years ago
[BE] Do not assign string literal to `char *` (#87949) Not sure, what I was thinking when writing something like: ``` auto foo = std::getenv("BAR"); if (!foo) { foo = "baz"; } ``` as `std::getenv` return `char *` (i.e. mutable string), but string literals are immutable. (i.e. `const char *`) Pull Request resolved: https://github.com/pytorch/pytorch/pull/87949 Approved by: https://github.com/kit1980
Author
Committer
Parents
Loading