fix: replace strncpy with memcpy and increase error message buffer size
Replace strncpy with memcpy in readBuiltInModule to avoid potential string termination issues when copying module source code, and increase ERROR_MESSAGE_SIZE from 60 to 80 to provide more room for compiler error messages with long variable names.
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
// is kind of hairy, but fortunately we can control what the longest possible
|
||||
// message is and handle that. Ideally, we'd use `snprintf()`, but that's not
|
||||
// available in standard C++98.
|
||||
#define ERROR_MESSAGE_SIZE (60 + MAX_VARIABLE_NAME + 15)
|
||||
#define ERROR_MESSAGE_SIZE (80 + MAX_VARIABLE_NAME + 15)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user