ensure that source buffer is always terminated by a uni::null (which isn't automatically true for basic_string<T>).

git-svn-id: svn://10.0.0.236/trunk@68828 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com 2000-05-09 06:31:54 +00:00
parent b4becb1155
commit c8f8269bbe
4 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@ JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 in
begin = b;
p = b;
end = b + Reader::source.size();
Reader::source.append(uni::null); // ensure last character is always '\0'
#ifdef DEBUG
recordString = 0;
#endif

View File

@ -40,7 +40,7 @@ namespace JavaScript {
const char16 *p; // Position in source text
const char16 *end; // End of source text; *end is a null character
public:
const String source; // Source text
String source; // Source text
const String sourceLocation; // Description of location from which the source text came
private:
const uint32 initialLineNum; // One-based number of current line

View File

@ -39,6 +39,7 @@ JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 in
begin = b;
p = b;
end = b + Reader::source.size();
Reader::source.append(uni::null); // ensure last character is always '\0'
#ifdef DEBUG
recordString = 0;
#endif

View File

@ -40,7 +40,7 @@ namespace JavaScript {
const char16 *p; // Position in source text
const char16 *end; // End of source text; *end is a null character
public:
const String source; // Source text
String source; // Source text
const String sourceLocation; // Description of location from which the source text came
private:
const uint32 initialLineNum; // One-based number of current line