summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--moduli.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 21afdb5c4..a590cf9d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
6 - djm@cvs.openbsd.org 2011/10/18 23:37:42 6 - djm@cvs.openbsd.org 2011/10/18 23:37:42
7 [ssh-add.c] 7 [ssh-add.c]
8 add -k to usage(); reminded by jmc@ 8 add -k to usage(); reminded by jmc@
9 - djm@cvs.openbsd.org 2011/10/19 00:06:10
10 [moduli.c]
11 s/tmpfile/tmp/ to make this -Wshadow clean
9 12
1020111025 1320111025
11 - (dtucker) [contrib/cygwin/Makefile] Continue if installing a doc file 14 - (dtucker) [contrib/cygwin/Makefile] Continue if installing a doc file
diff --git a/moduli.c b/moduli.c
index 0d3948a44..973ee6288 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: moduli.c,v 1.24 2011/10/16 15:51:39 stsp Exp $ */ 1/* $OpenBSD: moduli.c,v 1.25 2011/10/19 00:06:10 djm Exp $ */
2/* 2/*
3 * Copyright 1994 Phil Karn <karn@qualcomm.com> 3 * Copyright 1994 Phil Karn <karn@qualcomm.com>
4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> 4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -445,16 +445,16 @@ static void
445write_checkpoint(char *cpfile, u_int32_t lineno) 445write_checkpoint(char *cpfile, u_int32_t lineno)
446{ 446{
447 FILE *fp; 447 FILE *fp;
448 char tmpfile[MAXPATHLEN]; 448 char tmp[MAXPATHLEN];
449 int r; 449 int r;
450 450
451 r = snprintf(tmpfile, sizeof(tmpfile), "%s.XXXXXXXXXX", cpfile); 451 r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile);
452 if (r == -1 || r >= MAXPATHLEN) { 452 if (r == -1 || r >= MAXPATHLEN) {
453 logit("write_checkpoint: temp pathname too long"); 453 logit("write_checkpoint: temp pathname too long");
454 return; 454 return;
455 } 455 }
456 if ((r = mkstemp(tmpfile)) == -1) { 456 if ((r = mkstemp(tmp)) == -1) {
457 logit("mkstemp(%s): %s", tmpfile, strerror(errno)); 457 logit("mkstemp(%s): %s", tmp, strerror(errno));
458 return; 458 return;
459 } 459 }
460 if ((fp = fdopen(r, "w")) == NULL) { 460 if ((fp = fdopen(r, "w")) == NULL) {
@@ -463,7 +463,7 @@ write_checkpoint(char *cpfile, u_int32_t lineno)
463 return; 463 return;
464 } 464 }
465 if (fprintf(fp, "%lu\n", (unsigned long)lineno) > 0 && fclose(fp) == 0 465 if (fprintf(fp, "%lu\n", (unsigned long)lineno) > 0 && fclose(fp) == 0
466 && rename(tmpfile, cpfile) == 0) 466 && rename(tmp, cpfile) == 0)
467 debug3("wrote checkpoint line %lu to '%s'", 467 debug3("wrote checkpoint line %lu to '%s'",
468 (unsigned long)lineno, cpfile); 468 (unsigned long)lineno, cpfile);
469 else 469 else