diff options
Diffstat (limited to 'source/core/slang-io.cpp')
| -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"); |
