summaryrefslogtreecommitdiffstats
path: root/lib/libutil/login_class.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-04-08 11:04:56 +0000
committerru <ru@FreeBSD.org>2002-04-08 11:04:56 +0000
commit07997437f04ae67df52e5cf27edd45fc45b7b3a7 (patch)
tree43239812dcfdcb11364d9f2833b861bce4338e8b /lib/libutil/login_class.c
parent655eb3fb4f1633dec19cc1fae84cdbbefd47b2cf (diff)
downloadFreeBSD-src-07997437f04ae67df52e5cf27edd45fc45b7b3a7.zip
FreeBSD-src-07997437f04ae67df52e5cf27edd45fc45b7b3a7.tar.gz
Const poisoning.
Diffstat (limited to 'lib/libutil/login_class.c')
-rw-r--r--lib/libutil/login_class.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c
index b8b956b..dfd2d2c 100644
--- a/lib/libutil/login_class.c
+++ b/lib/libutil/login_class.c
@@ -126,7 +126,7 @@ static struct login_vars {
};
static char *
-substvar(char * var, const struct passwd * pwd, int hlen, int pch, int nlen)
+substvar(const char * var, const struct passwd * pwd, int hlen, int pch, int nlen)
{
char *np = NULL;
@@ -137,12 +137,10 @@ substvar(char * var, const struct passwd * pwd, int hlen, int pch, int nlen)
if (pwd != NULL) {
/* Count the number of ~'s in var to substitute */
- p = var;
- for (p = var; (p = strchr(p, '~')) != NULL; p++)
+ for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++)
++tildes;
/* Count the number of $'s in var to substitute */
- p = var;
- for (p = var; (p = strchr(p, '$')) != NULL; p++)
+ for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++)
++dollas;
}
@@ -197,8 +195,8 @@ setclassenvironment(login_cap_t *lc, const struct passwd * pwd, int paths)
++pch;
while (vars->tag != NULL) {
- char * var = paths ? login_getpath(lc, vars->tag, NULL)
- : login_getcapstr(lc, vars->tag, NULL, NULL);
+ const char * var = paths ? login_getpath(lc, vars->tag, NULL)
+ : login_getcapstr(lc, vars->tag, NULL, NULL);
char * np = substvar(var, pwd, hlen, pch, nlen);
OpenPOWER on IntegriCloud