summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2015-01-16 06:40:12 +0000
committerDamien Miller <djm@mindrot.org>2015-01-16 18:24:48 +1100
commit2ae4f337b2a5fb2841b6b0053b49496fef844d1c (patch)
tree59aac6ef59be3975eb3a1251abb0be330c008cdd /misc.c
parent3c4726f4c24118e8f1bb80bf75f1456c76df072c (diff)
upstream commit
Replace <sys/param.h> with <limits.h> and other less dirty headers where possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 2f11de40f..38af3dfe3 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.95 2014/10/24 02:01:20 lteo Exp $ */ 1/* $OpenBSD: misc.c,v 1.96 2015/01/16 06:40:12 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -30,8 +30,8 @@
30#include <sys/ioctl.h> 30#include <sys/ioctl.h>
31#include <sys/socket.h> 31#include <sys/socket.h>
32#include <sys/un.h> 32#include <sys/un.h>
33#include <sys/param.h>
34 33
34#include <limits.h>
35#include <stdarg.h> 35#include <stdarg.h>
36#include <stdio.h> 36#include <stdio.h>
37#include <stdlib.h> 37#include <stdlib.h>
@@ -551,7 +551,7 @@ tilde_expand_filename(const char *filename, uid_t uid)
551 if (path != NULL) 551 if (path != NULL)
552 filename = path + 1; 552 filename = path + 1;
553 553
554 if (xasprintf(&ret, "%s%s%s", pw->pw_dir, sep, filename) >= MAXPATHLEN) 554 if (xasprintf(&ret, "%s%s%s", pw->pw_dir, sep, filename) >= PATH_MAX)
555 fatal("tilde_expand_filename: Path too long"); 555 fatal("tilde_expand_filename: Path too long");
556 556
557 return (ret); 557 return (ret);