diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-07-08 17:15:10 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-07-08 17:15:10 +0200 |
commit | 2f91e250f601e61e58fcb63b9bd72d29d7fc866b (patch) | |
tree | 157db5acdb6c23edc9ed7894a401886f6cf4c620 | |
parent | 56269e2db835e50a4cf2681bb73c44ae41fcca10 (diff) | |
download | redot-engine-2f91e250f601e61e58fcb63b9bd72d29d7fc866b.tar.gz |
Add NULL-terminator the string passed to strtol.
This is actually expected by the function although it was apparently
working in GCC without the terminator, it breaks (at least some) clang
versions.
-rw-r--r-- | core/ustring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 706e8a3cc1..75e3b6f22e 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3338,7 +3338,7 @@ String String::http_unescape() const { if ((ord1 >= '0' && ord1 <= '9') || (ord1 >= 'A' && ord1 <= 'Z')) { CharType ord2 = ord_at(i + 2); if ((ord2 >= '0' && ord2 <= '9') || (ord2 >= 'A' && ord2 <= 'Z')) { - char bytes[2] = { (char)ord1, (char)ord2 }; + char bytes[3] = { (char)ord1, (char)ord2, 0 }; res += (char)strtol(bytes, NULL, 16); i += 2; } |