diff options
author | ru <ru@FreeBSD.org> | 2002-04-08 11:04:56 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-04-08 11:04:56 +0000 |
commit | 07997437f04ae67df52e5cf27edd45fc45b7b3a7 (patch) | |
tree | 43239812dcfdcb11364d9f2833b861bce4338e8b /lib/libutil/login_cap.c | |
parent | 655eb3fb4f1633dec19cc1fae84cdbbefd47b2cf (diff) | |
download | FreeBSD-src-07997437f04ae67df52e5cf27edd45fc45b7b3a7.zip FreeBSD-src-07997437f04ae67df52e5cf27edd45fc45b7b3a7.tar.gz |
Const poisoning.
Diffstat (limited to 'lib/libutil/login_cap.c')
-rw-r--r-- | lib/libutil/login_cap.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index 9797c8b..55784d7 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -344,8 +344,8 @@ login_getuserclass(const struct passwd *pwd) * an error string on error. */ -char * -login_getcapstr(login_cap_t *lc, const char *cap, char *def, char *error) +const char * +login_getcapstr(login_cap_t *lc, const char *cap, const char *def, const char *error) { char *res; int ret; @@ -373,7 +373,7 @@ login_getcaplist(login_cap_t *lc, const char *cap, const char *chars) if (chars == NULL) chars = ", \t"; - if ((lstring = login_getcapstr(lc, cap, NULL, NULL)) != NULL) + if ((lstring = (char *)login_getcapstr(lc, cap, NULL, NULL)) != NULL) return arrayize(lstring, chars, NULL); return NULL; } @@ -387,15 +387,15 @@ login_getcaplist(login_cap_t *lc, const char *cap, const char *chars) * If there is an error of any kind, return <error>. */ -char * -login_getpath(login_cap_t *lc, const char *cap, char * error) +const char * +login_getpath(login_cap_t *lc, const char *cap, const char *error) { - char *str; + const char *str; - if ((str = login_getcapstr(lc, (char*)cap, NULL, NULL)) == NULL) + if ((str = login_getcapstr(lc, cap, NULL, NULL)) == NULL) str = error; else { - char *ptr = str; + char *ptr = (char *)str; while (*ptr) { int count = strcspn(ptr, ", \t"); @@ -764,8 +764,8 @@ login_getcapbool(login_cap_t *lc, const char *cap, int def) * login_getstyle(lc, "skey", "network"); */ -char * -login_getstyle(login_cap_t *lc, char *style, const char *auth) +const char * +login_getstyle(login_cap_t *lc, const char *style, const char *auth) { int i; char **authtypes = NULL; |