summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-02-20 01:44:17 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-02-20 01:44:17 +0000
commitb8f1a1915038bd7cfda06cb95855197a81aac72d (patch)
tree399cddbfd71ecdbf040624f1b468bd244809428c /usr.sbin
parentdb073d0cfe9686e479277d34e326d933571f9a40 (diff)
Change hard coded numbers to sizeof(buf). Also change some
sizeof(buf) - 1 to sizeof(buf), since fgets takes the whole buffer size. Based on diff from Charles Longeau <chl at tuxfamily dot org> long ago. OK millert@.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/httpd/src/modules/standard/mod_cern_meta.c2
-rw-r--r--usr.sbin/ypserv/revnetgroup/parse_netgroup.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c b/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c
index 766f6a81515..44a252bf3b1 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_cern_meta.c
@@ -238,7 +238,7 @@ static int scan_meta_file(request_rec *r, FILE *f)
table *tmp_headers;
tmp_headers = ap_make_table(r->pool, 5);
- while (fgets(w, MAX_STRING_LEN - 1, f) != NULL) {
+ while (fgets(w, sizeof(w), f) != NULL) {
/* Delete terminal (CR?)LF */
diff --git a/usr.sbin/ypserv/revnetgroup/parse_netgroup.c b/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
index 1e2d935c18c..831a084b9cc 100644
--- a/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
+++ b/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse_netgroup.c,v 1.10 2006/04/03 05:01:23 deraadt Exp $ */
+/* $OpenBSD: parse_netgroup.c,v 1.11 2007/02/20 01:44:16 ray Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -47,7 +47,7 @@
#include "hash.h"
#ifndef lint
-static const char rcsid[] = "$OpenBSD: parse_netgroup.c,v 1.10 2006/04/03 05:01:23 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: parse_netgroup.c,v 1.11 2007/02/20 01:44:16 ray Exp $";
#endif
/*
@@ -335,7 +335,7 @@ read_for_group(char *group)
}
#ifdef CANT_HAPPEN
if (cont) {
- if (fgets(line, LINSIZ, netf)) {
+ if (fgets(line, sizeof(line), netf)) {
pos = line;
len = strlen(pos);
} else