summaryrefslogtreecommitdiff
path: root/moduli.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2015-01-20 23:14:00 +0000
committerDamien Miller <djm@mindrot.org>2015-01-26 23:58:53 +1100
commit087266ec33c76fc8d54ac5a19efacf2f4a4ca076 (patch)
tree71f57bb41b61561ebaa13026d8dc5d04d9829b00 /moduli.c
parent57e783c8ba2c0797f93977e83b2a8644a03065d8 (diff)
upstream commit
Reduce use of <sys/param.h> and transition to <limits.h> throughout. ok djm markus
Diffstat (limited to 'moduli.c')
-rw-r--r--moduli.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/moduli.c b/moduli.c
index 729d55c10..ed1bdc946 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: moduli.c,v 1.29 2014/08/21 01:08:52 doug Exp $ */ 1/* $OpenBSD: moduli.c,v 1.30 2015/01/20 23:14:00 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>
@@ -41,7 +41,7 @@
41 41
42#ifdef WITH_OPENSSL 42#ifdef WITH_OPENSSL
43 43
44#include <sys/param.h> 44#include <sys/param.h> /* MAX */
45#include <sys/types.h> 45#include <sys/types.h>
46 46
47#include <openssl/bn.h> 47#include <openssl/bn.h>
@@ -54,6 +54,7 @@
54#include <stdarg.h> 54#include <stdarg.h>
55#include <time.h> 55#include <time.h>
56#include <unistd.h> 56#include <unistd.h>
57#include <limits.h>
57 58
58#include "xmalloc.h" 59#include "xmalloc.h"
59#include "dh.h" 60#include "dh.h"
@@ -449,11 +450,11 @@ static void
449write_checkpoint(char *cpfile, u_int32_t lineno) 450write_checkpoint(char *cpfile, u_int32_t lineno)
450{ 451{
451 FILE *fp; 452 FILE *fp;
452 char tmp[MAXPATHLEN]; 453 char tmp[PATH_MAX];
453 int r; 454 int r;
454 455
455 r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); 456 r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile);
456 if (r == -1 || r >= MAXPATHLEN) { 457 if (r == -1 || r >= PATH_MAX) {
457 logit("write_checkpoint: temp pathname too long"); 458 logit("write_checkpoint: temp pathname too long");
458 return; 459 return;
459 } 460 }