summaryrefslogtreecommitdiff
path: root/moduli.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2019-07-03 03:24:02 +0000
committerDamien Miller <djm@mindrot.org>2019-07-05 11:15:30 +1000
commit8142fcaf9ed8ff66252deecbfd29fc59d5f2df4f (patch)
treecd3fbb3f81fd3be4b9f9047bed69ccf5df09849e /moduli.c
parent4d28fa78abce2890e136281950633fae2066cc29 (diff)
upstream: snprintf/vsnprintf return < 0 on error, rather than -1.
OpenBSD-Commit-ID: a261c421140a0639bb2b66bbceca72bf8239749d
Diffstat (limited to 'moduli.c')
-rw-r--r--moduli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/moduli.c b/moduli.c
index 7120415fd..578fc485c 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: moduli.c,v 1.34 2019/01/23 09:49:00 dtucker Exp $ */ 1/* $OpenBSD: moduli.c,v 1.35 2019/07/03 03:24:02 deraadt 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>
@@ -453,7 +453,7 @@ write_checkpoint(char *cpfile, u_int32_t lineno)
453 int r; 453 int r;
454 454
455 r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); 455 r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile);
456 if (r == -1 || r >= PATH_MAX) { 456 if (r < 0 || r >= PATH_MAX) {
457 logit("write_checkpoint: temp pathname too long"); 457 logit("write_checkpoint: temp pathname too long");
458 return; 458 return;
459 } 459 }