blob: cec20bb9652e7e6a923f5654879be81a258e2c1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
$NetBSD: patch-ah,v 1.1.1.1 2009/04/08 16:31:56 drochner Exp $
--- score.c.orig 1996-08-27 21:23:58.000000000 +0200
+++ score.c
@@ -633,10 +633,11 @@ static short WriteScore()
char tempfile[MAXPATHLEN];
strcpy(tempfile, tempnm);
- (void)mktemp(tempfile);
- scorefile = fopen(tempfile, "w");
+ sfdbn = mkstemp(tempfile);
+ if (sfdbn < 0)
+ return E_FOPENSCORE;
+ scorefile = fdopen(sfdbn, "w");
if (!scorefile) return E_FOPENSCORE;
- sfdbn = fileno(scorefile);
scoreentries = htons(scoreentries);
if (fwrite(SCORE_VERSION, 4, 1, scorefile) != 1) {
|