Make sure source strings are terminated (#1641)
* Make sure source strings are terminated The source strings may or may not have a null terminator. We need to make sure we add one before outputting the source strings as we iterate over the c-str looking for the null terminator. * Review feedback
This commit is contained in:
parent
6eab476e5a
commit
e96fa717d3
2 changed files with 6 additions and 3 deletions
|
|
@ -666,7 +666,7 @@ public:
|
|||
|
||||
void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; }
|
||||
const std::string& getSourceFile() const { return sourceFile; }
|
||||
void addSourceText(const char* text) { sourceText = sourceText + text; }
|
||||
void addSourceText(const char* text, size_t len) { sourceText.append(text, len); }
|
||||
const std::string& getSourceText() const { return sourceText; }
|
||||
const std::map<std::string, std::string>& getIncludeText() const { return includeText; }
|
||||
void addIncludeText(const char* name, const char* text, size_t len) { includeText[name].assign(text,len); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue