diff options
| author | bspeice <bspeice@users.noreply.github.com> | 2025-01-01 18:26:43 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-01 18:26:43 -0800 |
| commit | e3b71cf0356692bda5f0b3a06aed9d49ad3314a4 (patch) | |
| tree | 6bb5dd847275f5f940d974727ef738cd296bf6c3 /source | |
| parent | a13ef050996c2792ff3c16b6424d3a6336e56a58 (diff) | |
Allow explicit test root (#5980)
Diffstat (limited to 'source')
| -rw-r--r-- | source/core/slang-io.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp index 7bfde7bd7..3c0c9a11e 100644 --- a/source/core/slang-io.cpp +++ b/source/core/slang-io.cpp @@ -992,12 +992,12 @@ static SlangResult _calcExectuablePath(char* outPath, size_t* ioSize) { return SLANG_FAIL; } - if (size_t(resSize) >= bufferSize) + if (size_t(resSize + 1) >= bufferSize) { return SLANG_E_BUFFER_TOO_SMALL; } // Zero terminate - outPath[resSize - 1] = 0; + outPath[resSize] = 0; return SLANG_OK; #else String text = Slang::File::readAllText("/proc/self/maps"); |
