From e5d9823796afb71a9a198d3051c01d0381bb4370 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 26 Jul 1998 19:05:06 +0000 Subject: [PATCH] const poisoning. --- lib/libc/gen/__glob13.c | 14 +++++++------- lib/libc/gen/getgrent.c | 12 ++++++------ lib/libc/gen/pw_scan.c | 8 ++++---- lib/libc/net/rcmd.c | 8 ++++---- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/libc/gen/__glob13.c b/lib/libc/gen/__glob13.c index 1189ed3e8773..4e4f49bd30b6 100644 --- a/lib/libc/gen/__glob13.c +++ b/lib/libc/gen/__glob13.c @@ -1,4 +1,4 @@ -/* $NetBSD: __glob13.c,v 1.6 1998/06/19 22:53:57 kleink Exp $ */ +/* $NetBSD: __glob13.c,v 1.7 1998/07/26 19:05:06 mycroft Exp $ */ /* * Copyright (c) 1989, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; #else -__RCSID("$NetBSD: __glob13.c,v 1.6 1998/06/19 22:53:57 kleink Exp $"); +__RCSID("$NetBSD: __glob13.c,v 1.7 1998/07/26 19:05:06 mycroft Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -358,7 +358,7 @@ globtilde(pattern, patbuf, pglob) glob_t *pglob; { struct passwd *pwd; - char *h; + const char *h; const Char *p; Char *b; @@ -366,11 +366,11 @@ globtilde(pattern, patbuf, pglob) return pattern; /* Copy up to the end of the string or / */ - for (p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH; - *h++ = *p++) + for (p = pattern + 1, b = patbuf; *p && *p != SLASH; + *b++ = *p++) continue; - *h = EOS; + *b = EOS; if (((char *) patbuf)[0] == EOS) { /* @@ -388,7 +388,7 @@ globtilde(pattern, patbuf, pglob) /* * Expand a ~user */ - if ((pwd = getpwnam((char*) patbuf)) == NULL) + if ((pwd = getpwnam((char *) patbuf)) == NULL) return pattern; else h = pwd->pw_dir; diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 7ff24a8ffc18..1f0038f543d3 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1,4 +1,4 @@ -/* $NetBSD: getgrent.c,v 1.22 1998/02/26 03:01:12 perry Exp $ */ +/* $NetBSD: getgrent.c,v 1.23 1998/07/26 19:05:07 mycroft Exp $ */ /* * Copyright (c) 1989, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)getgrent.c 8.2 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: getgrent.c,v 1.22 1998/02/26 03:01:12 perry Exp $"); +__RCSID("$NetBSD: getgrent.c,v 1.23 1998/07/26 19:05:07 mycroft Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -72,7 +72,7 @@ static int grscan __P((int, gid_t, const char *)); static int start_gr __P((void)); #define MAXGRP 200 -static char *members[MAXGRP]; +static const char *members[MAXGRP]; #define MAXLINELENGTH 1024 static char line[MAXLINELENGTH]; @@ -176,8 +176,8 @@ grscan(search, gid, name) gid_t gid; const char *name; { - char *cp, **m; - char *bp, *ep; + const char **m; + char *cp, *bp, *ep; unsigned long id; #ifdef YP char *key, *data; @@ -362,7 +362,7 @@ parse: cp = NULL; if (bp == NULL) continue; - for (m = _gr_group.gr_mem = members;; bp++) { + for (_gr_group.gr_mem = m = members;; bp++) { if (m == &members[MAXGRP - 1]) break; if (*bp == ',') { diff --git a/lib/libc/gen/pw_scan.c b/lib/libc/gen/pw_scan.c index cd14a7e36f7c..5508a922a91e 100644 --- a/lib/libc/gen/pw_scan.c +++ b/lib/libc/gen/pw_scan.c @@ -1,4 +1,4 @@ -/* $NetBSD: pw_scan.c,v 1.3 1998/07/26 13:51:44 mycroft Exp $ */ +/* $NetBSD: pw_scan.c,v 1.4 1998/07/26 19:05:07 mycroft Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -35,7 +35,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: pw_scan.c,v 1.3 1998/07/26 13:51:44 mycroft Exp $"); +__RCSID("$NetBSD: pw_scan.c,v 1.4 1998/07/26 19:05:07 mycroft Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -64,8 +64,8 @@ __pw_scan(bp, pw, flags) { unsigned long id; int root, inflags; - char *p, *ep; - const char *sh; + char *ep; + const char *p, *sh; inflags = 0; if (flags != (int *)NULL) { diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 6d33359995ad..1cdf1c0b47f0 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rcmd.c,v 1.24 1998/07/18 05:04:36 lukem Exp $ */ +/* $NetBSD: rcmd.c,v 1.25 1998/07/26 19:05:08 mycroft Exp $ */ /* * Copyright (c) 1997 Matthew R. Green. @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #else -__RCSID("$NetBSD: rcmd.c,v 1.24 1998/07/18 05:04:36 lukem Exp $"); +__RCSID("$NetBSD: rcmd.c,v 1.25 1998/07/26 19:05:08 mycroft Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -75,7 +75,7 @@ int orcmd __P((char **, u_short, const char *, const char *, const char *, int *)); int __ivaliduser __P((FILE *, u_int32_t, const char *, const char *)); static int rshrcmd __P((char **, u_short, const char *, const char *, - const char *, int *, char *)); + const char *, int *, const char *)); static int hprcmd __P((struct hostent *, char **, u_short, const char *, const char *, const char *, int *)); static int __icheckhost __P((u_int32_t, const char *)); @@ -282,7 +282,7 @@ rshrcmd(ahost, rport, locuser, remuser, cmd, fd2p, rshcmd) u_short rport; const char *locuser, *remuser, *cmd; int *fd2p; - char *rshcmd; + const char *rshcmd; { pid_t pid; int sp[2], ep[2];