Skip to content

Commit

Permalink
Fix using strlen with non-NUL terminated string (ArkScript-lang#318)
Browse files Browse the repository at this point in the history
* Fix using strlen with non-NUL terminated string

* NUL terminator for ARK_VERSION_STR

Former-commit-id: 41623073a8d86ba2156d80579b57a64cf9763e1c
  • Loading branch information
mattn committed Oct 6, 2021
1 parent f67b80c commit 945d59f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/Ark/Constants.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ constexpr int ARK_VERSION_MINOR = @ARK_VERSION_MINOR@;
constexpr int ARK_VERSION_PATCH = @ARK_VERSION_PATCH@;
// clang-format on
constexpr int ARK_VERSION = (ARK_VERSION_MAJOR << 16) + (ARK_VERSION_MINOR << 8) + ARK_VERSION_PATCH;
constexpr char ARK_VERSION_STR[3] = { ARK_VERSION_MAJOR + '0', ARK_VERSION_MINOR + '0', ARK_VERSION_PATCH + '0' };
constexpr char ARK_VERSION_STR[4] = { ARK_VERSION_MAJOR + '0', ARK_VERSION_MINOR + '0', ARK_VERSION_PATCH + '0', 0x00 };

#define ARK_COMPILATION_OPTIONS "@ARK_COMPILATION_OPTIONS@"
#define ARK_COMPILER "@ARK_COMPILER@"
Expand Down

0 comments on commit 945d59f

Please sign in to comment.