Browse Source

use proper __findenv() prototype; millert@ ok

OPENBSD_3_3
mickey 21 years ago
parent
commit
b20c936570
2 changed files with 8 additions and 8 deletions
  1. +5
    -6
      src/lib/libc/stdlib/getenv.c
  2. +3
    -2
      src/lib/libc/stdlib/setenv.c

+ 5
- 6
src/lib/libc/stdlib/getenv.c View File

@ -32,12 +32,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: getenv.c,v 1.4 1998/07/16 18:02:33 deraadt Exp $";
static char *rcsid = "$OpenBSD: getenv.c,v 1.5 2002/12/10 22:44:12 mickey Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
char *__findenv(const char *name, int *offset);
/* /*
* __findenv -- * __findenv --
* Returns pointer to value associated with name, if any, else NULL. * Returns pointer to value associated with name, if any, else NULL.
@ -48,9 +50,7 @@ static char *rcsid = "$OpenBSD: getenv.c,v 1.4 1998/07/16 18:02:33 deraadt Exp $
* This routine *should* be a static; don't use it. * This routine *should* be a static; don't use it.
*/ */
char * char *
__findenv(name, offset)
register const char *name;
int *offset;
__findenv(const char *name, int *offset)
{ {
extern char **environ; extern char **environ;
register int len, i; register int len, i;
@ -83,7 +83,6 @@ getenv(name)
const char *name; const char *name;
{ {
int offset; int offset;
char *__findenv();
return(__findenv(name, &offset));
return (__findenv(name, &offset));
} }

+ 3
- 2
src/lib/libc/stdlib/setenv.c View File

@ -32,12 +32,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: setenv.c,v 1.4 2001/07/09 06:57:45 deraadt Exp $";
static char *rcsid = "$OpenBSD: setenv.c,v 1.5 2002/12/10 22:44:13 mickey Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
char *__findenv(const char *name, int *offset);
/* /*
* setenv -- * setenv --
* Set the value of the environmental variable "name" to be * Set the value of the environmental variable "name" to be
@ -53,7 +55,6 @@ setenv(name, value, rewrite)
static int alloced; /* if allocated space before */ static int alloced; /* if allocated space before */
register char *C; register char *C;
int l_value, offset; int l_value, offset;
char *__findenv();
if (*value == '=') /* no `=' in value */ if (*value == '=') /* no `=' in value */
++value; ++value;


Loading…
Cancel
Save