$OpenBSD: patch-Scorelist_cc,v 1.1 2003/04/15 12:41:25 wilfried Exp $
--- Scorelist.cc.orig	Thu Jan 23 17:22:50 1997
+++ Scorelist.cc	Tue Apr 15 13:13:59 2003
@@ -2,7 +2,7 @@
 
 FILE *Scorelist::open_file(char *mode) {
 	char file[255];
-	sprintf (file, "%sscores", XBILL_HOME);
+	sprintf (file, "%sscores", "/var/games/xbill.");
 	return fopen (file, mode);
 }
 
@@ -11,8 +11,14 @@ void Scorelist::read() {
 	int i;
 	if (scorefile) {
 		for (i=0; i<10; i++) {
-			fgets (name[i], 21, scorefile);
-			fscanf (scorefile, "%d%d\n", &(level[i]), &(score[i]));
+			char temp[40];
+			if (fgets (temp, sizeof(temp), scorefile)) {
+				strlcpy (name[i], temp, sizeof(name[0]));
+				sscanf (temp+21, "%d%d\n", &(level[i]), &(score[i]));
+			} else {
+				strcpy(name[i], "me");
+				level[i] = score[i] = 0;
+			}
 		}
 		fclose(scorefile);
 	}
@@ -48,7 +54,7 @@ void Scorelist::recalc (char *str) {
 		}
 		else break;
 	}
-	strcpy (name[i], str);
+	strlcpy (name[i], str, sizeof(name[0]));
 	level[i] = game.level;
 	score[i] = game.score;
 }
