diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2003-10-26 03:51:47 +0000 | 
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2003-10-26 03:51:47 +0000 | 
| commit | 05bcd1d0988e7d3c1e445a850762969b0d6adfeb (patch) | |
| tree | e1559e640f427a56308fcdcfac8c4c3a37b7f6c7 | |
| parent | 4f7593692290f2ccb9fdc55ac231dcfbfc5ea4be (diff) | |
Notes
| -rw-r--r-- | lib/libutil/login_cap.c | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index 8347b5100dcc..ad1dacbb6a79 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -104,21 +104,22 @@ static const char **  arrayize(const char *str, const char *chars, int *size)  {      int	    i; -    const char *ptr; +    char *ptr; +    const char *cptr;      const char **res = NULL;      /* count the sub-strings */ -    for (i = 0, ptr = str; *ptr; i++) { -	int count = strcspn(ptr, chars); -	ptr += count; -	if (*ptr) -	    ++ptr; +    for (i = 0, cptr = str; *cptr; i++) { +	int count = strcspn(cptr, chars); +	cptr += count; +	if (*cptr) +	    ++cptr;      }      /* alloc the array */      if ((ptr = allocstr(str)) != NULL) {  	if ((res = allocarray(++i)) == NULL) -	    free(str); +	    free((void *)(uintptr_t)(const void *)str);  	else {  	    /* now split the string */  	    i = 0; @@ -191,7 +192,7 @@ login_getclassbyname(char const *name, const struct passwd *pwd)  	const char  *dir;  	char	    userpath[MAXPATHLEN]; -	static const char *login_dbarray[] = { NULL, NULL, NULL }; +	static char *login_dbarray[] = { NULL, NULL, NULL };  	me = (name != NULL && strcmp(name, LOGIN_MECLASS) == 0);  	dir = (!me || pwd == NULL) ? NULL : pwd->pw_dir;  | 
