Commit 0c70eb8d authored by Camilla Löwy's avatar Camilla Löwy
Browse files

Unify error message buffer lengths

parent 08737bdc
......@@ -148,7 +148,7 @@ static void terminate(void)
void _glfwInputError(int code, const char* format, ...)
{
_GLFWerror* error;
char description[1024];
char description[_GLFW_MESSAGE_SIZE];
if (format)
{
......
......@@ -54,6 +54,8 @@
#define _GLFW_POLL_BUTTONS 2
#define _GLFW_POLL_ALL (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS)
#define _GLFW_MESSAGE_SIZE 1024
typedef int GLFWbool;
typedef struct _GLFWerror _GLFWerror;
......@@ -263,7 +265,7 @@ struct _GLFWerror
{
_GLFWerror* next;
int code;
char description[1024];
char description[_GLFW_MESSAGE_SIZE];
};
/*! @brief Initialization configuration.
......
......@@ -412,8 +412,8 @@ char* _glfwCreateUTF8FromWideStringWin32(const WCHAR* source)
//
void _glfwInputErrorWin32(int error, const char* description)
{
WCHAR buffer[1024] = L"";
char message[2048] = "";
WCHAR buffer[_GLFW_MESSAGE_SIZE] = L"";
char message[_GLFW_MESSAGE_SIZE] = "";
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS |
......
......@@ -779,7 +779,7 @@ void _glfwReleaseErrorHandlerX11(void)
//
void _glfwInputErrorX11(int error, const char* message)
{
char buffer[8192];
char buffer[_GLFW_MESSAGE_SIZE];
XGetErrorText(_glfw.x11.display, _glfw.x11.errorCode,
buffer, sizeof(buffer));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment