Skip to content

Commit

Permalink
Fixed narrowing type conversion.
Browse files Browse the repository at this point in the history
This was causing some crashes in some 64-bit drop-in installations.
Thanks to ittegrat.
  • Loading branch information
mitchell committed Sep 18, 2021
1 parent 0e7a915 commit b256ddf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LexLPeg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class LexerLPeg : public DefaultLexer {
* @param str The string to copy.
* @return number of bytes needed to hold *str*
*/
void *StringResult(long lparam, const char *str);
void *StringResult(sptr_t lparam, const char *str);

public:
// Lexer property keys.
Expand Down Expand Up @@ -646,7 +646,7 @@ bool LexerLPeg::Init() {
return true;
}

void *LexerLPeg::StringResult(long lparam, const char *str) {
void *LexerLPeg::StringResult(sptr_t lparam, const char *str) {
if (lparam) strcpy(reinterpret_cast<char *>(lparam), str);
return reinterpret_cast<void *>(strlen(str));
}
Expand Down
1 change: 1 addition & 0 deletions docs/thanks.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and better over the years.
* Florian Fischer
* Heck Fy
* Hugo O. Rivera
* ittegrat
* Ivan Baidakou
* Jason Schindler
* Jeff Stone
Expand Down

0 comments on commit b256ddf

Please sign in to comment.