Parcourir la source

ngage: SDL_GetPrefPath allows a NULL `org` parameter.

Reference Issue #13322.
Ryan C. Gordon il y a 2 mois
Parent
commit
343ad3eddd
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      src/filesystem/ngage/SDL_sysfilesystem.c

+ 4 - 4
src/filesystem/ngage/SDL_sysfilesystem.c

@@ -32,11 +32,11 @@ char *SDL_SYS_GetBasePath(void)
 
 
 char *SDL_SYS_GetPrefPath(const char *org, const char *app)
 char *SDL_SYS_GetPrefPath(const char *org, const char *app)
 {
 {
-    char *pref_path;
-    if (SDL_asprintf(&pref_path, "C:/System/Apps/%s/%s/", org, app) < 0)
+    char *pref_path = NULL;
+    if (SDL_asprintf(&pref_path, "C:/System/Apps/%s/%s/", org ? org : "SDL_App", app) < 0) {
         return NULL;
         return NULL;
-    else
-        return pref_path;
+    }
+    return pref_path;
 }
 }
 
 
 char *SDL_SYS_GetUserFolder(SDL_Folder folder)
 char *SDL_SYS_GetUserFolder(SDL_Folder folder)