Avoid hitting ERR_MAX_STRLEN limit.
authorMark Callow <libsdl.org@callow.im>
Fri, 22 Sep 2017 22:30:02 +0900
changeset 115180c51e6ef1b73
parent 11517 beb96c015b30
child 11519 535b0c8ba4ce
Avoid hitting ERR_MAX_STRLEN limit.
src/video/SDL_vulkan_utils.c
     1.1 --- a/src/video/SDL_vulkan_utils.c	Fri Sep 22 07:42:24 2017 -0400
     1.2 +++ b/src/video/SDL_vulkan_utils.c	Fri Sep 22 22:30:02 2017 +0900
     1.3 @@ -99,9 +99,13 @@
     1.4      VkExtensionProperties *retval;
     1.5      if(result == VK_ERROR_INCOMPATIBLE_DRIVER)
     1.6      {
     1.7 +        /* Avoid the ERR_MAX_STRLEN limit by passing part of the message
     1.8 +         * as a string argument.
     1.9 +         */
    1.10          SDL_SetError(
    1.11 -            "You probably don't have a working Vulkan driver installed: getting Vulkan "
    1.12 -            "extensions failed: vkEnumerateInstanceExtensionProperties returned %s(%d)",
    1.13 +            "You probably don't have a working Vulkan driver installed. %s %s %s(%d)",
    1.14 +            "Getting Vulkan extensions failed:",
    1.15 +            "vkEnumerateInstanceExtensionProperties returned",
    1.16              SDL_Vulkan_GetResultString(result),
    1.17              (int)result);
    1.18          return NULL;