[openjk] 114/130: SP: Don't try to open invalid file names in UI model loader

Simon McVittie smcv at debian.org
Fri Oct 28 11:09:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit f832cf69ff74c800c1f7f45b20107cbb98bccc2d
Author: Ensiform <ensiform at gmail.com>
Date:   Sat Oct 22 14:31:57 2016 -0500

    SP: Don't try to open invalid file names in UI model loader
    
    Previously `models/players//PlayerChoice.txt` was attempting to be
    loaded.  This difference was already in the MP codebase so it appears to
    be a slight oversight in the codebases.
---
 code/ui/ui_main.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/code/ui/ui_main.cpp b/code/ui/ui_main.cpp
index 19e3554..2fd0aae 100644
--- a/code/ui/ui_main.cpp
+++ b/code/ui/ui_main.cpp
@@ -2422,7 +2422,15 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad )
 
 		dirlen = strlen(dirptr);
 
-		if (dirlen && dirptr[dirlen-1]=='/') dirptr[dirlen-1]='\0';
+		if (dirlen)
+		{
+			if (dirptr[dirlen-1]=='/')
+				dirptr[dirlen-1]='\0';
+		}
+		else
+		{
+			continue;
+		}
 
 		if (!strcmp(dirptr,".") || !strcmp(dirptr,".."))
 			continue;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list