aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-07-31 09:33:21 -0600
committerJon Ashburn <jon@lunarg.com>2015-07-31 09:42:39 -0600
commit39e2926256c8d0c5c62a4bce831cf4efc3fda6a4 (patch)
tree01bab5bce46611324ccc01b8b0b499d542a3c6d3 /loader/loader.c
parent7a24cfcd22e02a3db7af4f94667fadf0b0b69693 (diff)
downloadusermoji-39e2926256c8d0c5c62a4bce831cf4efc3fda6a4.tar.xz
loader: Fix bug in Windows for mod a static string DEFAULT_VK_LAYERS_INFO
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/loader/loader.c b/loader/loader.c
index ff26ee8d..8fd4b10a 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -189,7 +189,7 @@ static void loader_log(VkFlags msg_type, int32_t msg_code,
* A string list of filenames as pointer.
* When done using the returned string list, pointer should be freed.
*/
-static char *loader_get_registry_files(const char *location)
+static char *loader_get_registry_files(char *location)
{
LONG rtn_value;
HKEY hive, key;
@@ -1433,19 +1433,18 @@ static void loader_get_manifest_files(const char *env_override,
// Make a copy of the input we are using so it is not modified
// Also handle getting the location(s) from registry on Windows
if (override == NULL) {
-#if defined (_WIN32)
- loc = loader_get_registry_files(location);
- if (loc == NULL) {
- loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Registry lookup failed can't get manifest files");
- return;
- }
-#else
loc = alloca(strlen(location) + 1);
if (loc == NULL) {
loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Out of memory can't get manifest files");
return;
}
strcpy(loc, location);
+#if defined (_WIN32)
+ loc = loader_get_registry_files(loc);
+ if (loc == NULL) {
+ loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Registry lookup failed can't get manifest files");
+ return;
+ }
#endif
}
else {