- avoid unitialized warning.

- remove unreachable code.
- add ARGSUSED
- linted for const castaway.
This commit is contained in:
christos 1999-01-20 13:11:18 +00:00
parent a45cc02ea7
commit 78427083c5
1 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: getusershell.c,v 1.15 1999/01/19 08:30:48 lukem Exp $ */ /* $NetBSD: getusershell.c,v 1.16 1999/01/20 13:11:18 christos Exp $ */
/* /*
* Copyright (c) 1985, 1993 * Copyright (c) 1985, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: getusershell.c,v 1.15 1999/01/19 08:30:48 lukem Exp $"); __RCSID("$NetBSD: getusershell.c,v 1.16 1999/01/20 13:11:18 christos Exp $");
#endif #endif
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -89,6 +89,7 @@ getusershell()
if (curshell == NULL) if (curshell == NULL)
curshell = initshells(); curshell = initshells();
/*LINTED*/
ret = (__aconst char *)*curshell; ret = (__aconst char *)*curshell;
if (ret != NULL) if (ret != NULL)
curshell++; curshell++;
@ -114,6 +115,7 @@ setusershell()
static int _local_initshells __P((void *, void *, va_list)); static int _local_initshells __P((void *, void *, va_list));
/*ARGSUSED*/
static int static int
_local_initshells(rv, cb_data, ap) _local_initshells(rv, cb_data, ap)
void *rv; void *rv;
@ -150,6 +152,7 @@ _local_initshells(rv, cb_data, ap)
#ifdef HESIOD #ifdef HESIOD
static int _dns_initshells __P((void *, void *, va_list)); static int _dns_initshells __P((void *, void *, va_list));
/*ARGSUSED*/
static int static int
_dns_initshells(rv, cb_data, ap) _dns_initshells(rv, cb_data, ap)
void *rv; void *rv;
@ -184,13 +187,13 @@ _dns_initshells(rv, cb_data, ap)
free(hp); free(hp);
} }
} }
return NS_SUCCESS;
} }
#endif /* HESIOD */ #endif /* HESIOD */
#ifdef YP #ifdef YP
static int _nis_initshells __P((void *, void *, va_list)); static int _nis_initshells __P((void *, void *, va_list));
/*ARGSUSED*/
static int static int
_nis_initshells(rv, cb_data, ap) _nis_initshells(rv, cb_data, ap)
void *rv; void *rv;
@ -216,7 +219,7 @@ _nis_initshells(rv, cb_data, ap)
for (;;) { for (;;) {
char *ypcur = NULL; char *ypcur = NULL;
int ypcurlen; int ypcurlen = 0; /* XXX: GCC */
char *key, *data; char *key, *data;
int keylen, datalen; int keylen, datalen;
int r; int r;
@ -250,7 +253,6 @@ _nis_initshells(rv, cb_data, ap)
data[datalen] = '\0'; /* clear trailing \n */ data[datalen] = '\0'; /* clear trailing \n */
sl_add(sl, data); sl_add(sl, data);
} }
return NS_SUCCESS;
} }
#endif /* YP */ #endif /* YP */