[Commits] SDL: Vulkan: Allow SDL_Vulkan_GetInstanceExtensions to be called...

libsdl.org revision control commits-owner at libsdl.org
Wed Jan 17 13:03:44 PST 2018


details:   https://hg.libsdl.org/SDL/rev/922c27f2fa56
changeset: 11827:922c27f2fa56
user:      John Bartholomew <jpa.bartholomew at gmail.com>
date:      Sun Jan 14 13:34:50 2018 +0000
description:
Vulkan: Allow SDL_Vulkan_GetInstanceExtensions to be called with a larger array than necessary.

diffstat:

 src/video/SDL_vulkan_utils.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (28 lines):

diff -r 13d922b387db -r 922c27f2fa56 src/video/SDL_vulkan_utils.c
--- a/src/video/SDL_vulkan_utils.c	Sat Jan 13 01:58:11 2018 +0100
+++ b/src/video/SDL_vulkan_utils.c	Sun Jan 14 13:34:50 2018 +0000
@@ -156,10 +156,10 @@
     {
 		unsigned int i;
 
-        if(*userCount != nameCount)
+        if(*userCount < nameCount)
         {
             SDL_SetError(
-                "Count doesn't match count from previous call of SDL_Vulkan_GetInstanceExtensions");
+                "Ouput array for SDL_Vulkan_GetInstanceExtensions is too small");
             return SDL_FALSE;
         }
         for(i = 0; i < nameCount; i++)
@@ -167,10 +167,7 @@
             userNames[i] = names[i];
         }
     }
-    else
-    {
-        *userCount = nameCount;
-    }
+    *userCount = nameCount;
     return SDL_TRUE;
 }
 


More information about the commits mailing list