mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03:00
Fix potential segfault when formatting error msg (#2160)
This commit is contained in:
parent
2f48a468ca
commit
b82d87d6ee
1 changed files with 7 additions and 1 deletions
|
@ -224,7 +224,13 @@ void initFromPathString(const char *&dest, const cl::opt<std::string> &src) {
|
|||
dest = nullptr;
|
||||
if (src.getNumOccurrences() != 0) {
|
||||
if (src.empty()) {
|
||||
error(Loc(), "Expected argument to '-%s'", src.ArgStr);
|
||||
error(Loc(), "Expected argument to '-%s'",
|
||||
#if LDC_LLVM_VER >= 308
|
||||
src.ArgStr.str().c_str()
|
||||
#else
|
||||
src.ArgStr
|
||||
#endif
|
||||
);
|
||||
}
|
||||
dest = dupPathString(src);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue