summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-07-09 06:57:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-07-09 06:57:46 +0000
commit5e18c2b7bf584f7defb8b73f3e0a4843e3da9bbc (patch)
treed0465cd6e1cbbd6344562de8dd7480b043ae0fc2
parent89da542295094c69854c9bfec672d7f26cb8e581 (diff)
a first pass at -Wall
-rw-r--r--lib/libc/gen/authenticate.c8
-rw-r--r--lib/libc/gen/nlist.c3
-rw-r--r--lib/libc/stdio/fgets.c3
-rw-r--r--lib/libc/stdio/fputc.c3
-rw-r--r--lib/libc/stdio/fread.c3
-rw-r--r--lib/libc/stdio/fscanf.c3
-rw-r--r--lib/libc/stdio/fvwrite.c3
-rw-r--r--lib/libc/stdio/fwalk.c3
-rw-r--r--lib/libc/stdio/getchar.c3
-rw-r--r--lib/libc/stdio/putchar.c3
-rw-r--r--lib/libc/stdio/putw.c3
-rw-r--r--lib/libc/stdio/refill.c5
-rw-r--r--lib/libc/stdio/rget.c4
-rw-r--r--lib/libc/stdio/scanf.c3
-rw-r--r--lib/libc/stdio/setvbuf.c3
-rw-r--r--lib/libc/stdio/sscanf.c3
-rw-r--r--lib/libc/stdio/stdio.c5
-rw-r--r--lib/libc/stdio/tempnam.c12
-rw-r--r--lib/libc/stdio/ungetc.c8
-rw-r--r--lib/libc/stdio/vfprintf.c4
-rw-r--r--lib/libc/stdio/vfscanf.c3
-rw-r--r--lib/libc/stdio/vprintf.c3
-rw-r--r--lib/libc/stdio/vscanf.c3
-rw-r--r--lib/libc/stdio/vsprintf.c3
-rw-r--r--lib/libc/stdio/vsscanf.c3
-rw-r--r--lib/libc/stdio/wbuf.c3
-rw-r--r--lib/libc/stdio/wsetup.c3
-rw-r--r--lib/libc/stdlib/setenv.c7
-rw-r--r--lib/libc/stdlib/strtod.c12
29 files changed, 75 insertions, 50 deletions
diff --git a/lib/libc/gen/authenticate.c b/lib/libc/gen/authenticate.c
index 238400c1804..a0da2831bcd 100644
--- a/lib/libc/gen/authenticate.c
+++ b/lib/libc/gen/authenticate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authenticate.c,v 1.4 2001/07/02 19:22:34 millert Exp $ */
+/* $OpenBSD: authenticate.c,v 1.5 2001/07/09 06:57:42 deraadt Exp $ */
/*-
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -103,9 +103,6 @@ auth_mkvalue(char *value)
void
auth_checknologin(login_cap_t *lc)
{
- struct stat sb;
- char *nologin;
-
if (_auth_checknologin(lc, 1))
exit(1);
}
@@ -179,7 +176,7 @@ auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type)
if (as != NULL)
pwd = auth_getpwd(as);
- if (pwd == NULL)
+ if (pwd == NULL) {
if (name != NULL)
pwd = getpwnam(name);
else {
@@ -190,6 +187,7 @@ auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type)
}
name = pwd->pw_name;
}
+ }
if (name == NULL)
name = pwd->pw_name;
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index bf3e803267d..bad454b25c6 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: nlist.c,v 1.39 2001/05/11 12:51:23 art Exp $";
+static char rcsid[] = "$OpenBSD: nlist.c,v 1.40 2001/07/09 06:57:43 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -429,7 +429,6 @@ __elf_fdnlist(fd, list)
continue;
for (p = list; !ISLAST(p); p++) {
char *sym;
- int again = 0;
/*
* First we check for the symbol as it was
diff --git a/lib/libc/stdio/fgets.c b/lib/libc/stdio/fgets.c
index 29e91ad4593..c2bf76f79cf 100644
--- a/lib/libc/stdio/fgets.c
+++ b/lib/libc/stdio/fgets.c
@@ -35,11 +35,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fgets.c,v 1.2 1996/08/19 08:32:33 tholo Exp $";
+static char rcsid[] = "$OpenBSD: fgets.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <string.h>
+#include "local.h"
/*
* Read at most n-1 characters from the given file.
diff --git a/lib/libc/stdio/fputc.c b/lib/libc/stdio/fputc.c
index ed6c256f5c9..056550637c4 100644
--- a/lib/libc/stdio/fputc.c
+++ b/lib/libc/stdio/fputc.c
@@ -35,13 +35,14 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fputc.c,v 1.3 1996/10/28 05:32:54 tholo Exp $";
+static char rcsid[] = "$OpenBSD: fputc.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <errno.h>
#include "local.h"
+int
fputc(c, fp)
int c;
register FILE *fp;
diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c
index 4773abfa458..e3354c30095 100644
--- a/lib/libc/stdio/fread.c
+++ b/lib/libc/stdio/fread.c
@@ -35,11 +35,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fread.c,v 1.2 1996/08/19 08:32:44 tholo Exp $";
+static char rcsid[] = "$OpenBSD: fread.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <string.h>
+#include "local.h"
size_t
fread(buf, size, count, fp)
diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c
index 33b7e8a6a62..009dbe8202e 100644
--- a/lib/libc/stdio/fscanf.c
+++ b/lib/libc/stdio/fscanf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fscanf.c,v 1.3 1997/07/25 20:30:09 mickey Exp $";
+static char rcsid[] = "$OpenBSD: fscanf.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -45,6 +45,7 @@ static char rcsid[] = "$OpenBSD: fscanf.c,v 1.3 1997/07/25 20:30:09 mickey Exp $
#include <varargs.h>
#endif
+int
#ifdef __STDC__
fscanf(FILE *fp, char const *fmt, ...) {
int ret;
diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c
index 0f7b20f9eed..701b2fc397f 100644
--- a/lib/libc/stdio/fvwrite.c
+++ b/lib/libc/stdio/fvwrite.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.10 1999/08/07 17:42:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.11 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -51,6 +51,7 @@ static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.10 1999/08/07 17:42:48 millert Ex
* This routine is large and unsightly, but most of the ugliness due
* to the three different kinds of output buffering is handled here.
*/
+int
__sfvwrite(fp, uio)
register FILE *fp;
register struct __suio *uio;
diff --git a/lib/libc/stdio/fwalk.c b/lib/libc/stdio/fwalk.c
index fd05d21d83e..7d5ec390cfa 100644
--- a/lib/libc/stdio/fwalk.c
+++ b/lib/libc/stdio/fwalk.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fwalk.c,v 1.2 1996/08/19 08:32:50 tholo Exp $";
+static char rcsid[] = "$OpenBSD: fwalk.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <errno.h>
@@ -43,6 +43,7 @@ static char rcsid[] = "$OpenBSD: fwalk.c,v 1.2 1996/08/19 08:32:50 tholo Exp $";
#include "local.h"
#include "glue.h"
+int
_fwalk(function)
register int (*function)();
{
diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c
index 030d5bf1faf..029f19f94fd 100644
--- a/lib/libc/stdio/getchar.c
+++ b/lib/libc/stdio/getchar.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getchar.c,v 1.2 1996/08/19 08:32:52 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getchar.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -45,6 +45,7 @@ static char rcsid[] = "$OpenBSD: getchar.c,v 1.2 1996/08/19 08:32:52 tholo Exp $
#undef getchar
+int
getchar()
{
return (getc(stdin));
diff --git a/lib/libc/stdio/putchar.c b/lib/libc/stdio/putchar.c
index 82fa4b100a8..22aa47aaefb 100644
--- a/lib/libc/stdio/putchar.c
+++ b/lib/libc/stdio/putchar.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: putchar.c,v 1.2 1996/08/19 08:32:59 tholo Exp $";
+static char rcsid[] = "$OpenBSD: putchar.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -45,6 +45,7 @@ static char rcsid[] = "$OpenBSD: putchar.c,v 1.2 1996/08/19 08:32:59 tholo Exp $
/*
* A subroutine version of the macro putchar
*/
+int
putchar(c)
int c;
{
diff --git a/lib/libc/stdio/putw.c b/lib/libc/stdio/putw.c
index bc992da316d..7fa02062445 100644
--- a/lib/libc/stdio/putw.c
+++ b/lib/libc/stdio/putw.c
@@ -35,12 +35,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: putw.c,v 1.2 1996/08/19 08:33:00 tholo Exp $";
+static char rcsid[] = "$OpenBSD: putw.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include "fvwrite.h"
+int
putw(w, fp)
int w;
FILE *fp;
diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c
index 865a503228b..768295e649d 100644
--- a/lib/libc/stdio/refill.c
+++ b/lib/libc/stdio/refill.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: refill.c,v 1.4 1999/08/07 17:35:58 millert Exp $";
+static char rcsid[] = "$OpenBSD: refill.c,v 1.5 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <errno.h>
@@ -43,7 +43,7 @@ static char rcsid[] = "$OpenBSD: refill.c,v 1.4 1999/08/07 17:35:58 millert Exp
#include <stdlib.h>
#include "local.h"
-static
+static int
lflush(fp)
FILE *fp;
{
@@ -57,6 +57,7 @@ lflush(fp)
* Refill a stdio buffer.
* Return EOF on eof or error, 0 otherwise.
*/
+int
__srefill(fp)
register FILE *fp;
{
diff --git a/lib/libc/stdio/rget.c b/lib/libc/stdio/rget.c
index 78303af97b9..867f2f94b66 100644
--- a/lib/libc/stdio/rget.c
+++ b/lib/libc/stdio/rget.c
@@ -35,16 +35,18 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: rget.c,v 1.2 1996/08/19 08:33:02 tholo Exp $";
+static char rcsid[] = "$OpenBSD: rget.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+#include "local.h"
/*
* Handle getc() when the buffer ran out:
* Refill, then return the first character
* in the newly-filled buffer.
*/
+int
__srget(fp)
register FILE *fp;
{
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index dd73700832d..0897f817979 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: scanf.c,v 1.3 1997/07/25 20:30:10 mickey Exp $";
+static char rcsid[] = "$OpenBSD: scanf.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -45,6 +45,7 @@ static char rcsid[] = "$OpenBSD: scanf.c,v 1.3 1997/07/25 20:30:10 mickey Exp $"
#include <varargs.h>
#endif
+int
#ifdef __STDC__
scanf(char const *fmt, ...)
#else
diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c
index d82d08144da..65501fce9d9 100644
--- a/lib/libc/stdio/setvbuf.c
+++ b/lib/libc/stdio/setvbuf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.2 1996/08/19 08:33:05 tholo Exp $";
+static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -46,6 +46,7 @@ static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.2 1996/08/19 08:33:05 tholo Exp $
* Set one of the three kinds of buffering, optionally including
* a buffer.
*/
+int
setvbuf(fp, buf, mode, size)
register FILE *fp;
char *buf;
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index eb249fbf65e..f5bee8f9b70 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sscanf.c,v 1.3 1997/07/25 20:30:12 mickey Exp $";
+static char rcsid[] = "$OpenBSD: sscanf.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -58,6 +58,7 @@ eofread(cookie, buf, len)
return (0);
}
+int
#ifdef __STDC__
sscanf(const char *str, char const *fmt, ...)
#else
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c
index 08d8533f8f9..17d413164d3 100644
--- a/lib/libc/stdio/stdio.c
+++ b/lib/libc/stdio/stdio.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: stdio.c,v 1.3 1997/11/09 23:40:41 flipk Exp $";
+static char rcsid[] = "$OpenBSD: stdio.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <fcntl.h>
@@ -47,6 +47,7 @@ static char rcsid[] = "$OpenBSD: stdio.c,v 1.3 1997/11/09 23:40:41 flipk Exp $";
* Small standard I/O/seek/close functions.
* These maintain the `known seek offset' for seek optimisation.
*/
+int
__sread(cookie, buf, n)
void *cookie;
char *buf;
@@ -64,6 +65,7 @@ __sread(cookie, buf, n)
return (ret);
}
+int
__swrite(cookie, buf, n)
void *cookie;
char const *buf;
@@ -96,6 +98,7 @@ __sseek(cookie, offset, whence)
return (ret);
}
+int
__sclose(cookie)
void *cookie;
{
diff --git a/lib/libc/stdio/tempnam.c b/lib/libc/stdio/tempnam.c
index 7c5f95e642d..80af80f790b 100644
--- a/lib/libc/stdio/tempnam.c
+++ b/lib/libc/stdio/tempnam.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: tempnam.c,v 1.9 1997/04/03 05:31:37 millert Exp $";
+static char rcsid[] = "$OpenBSD: tempnam.c,v 1.10 2001/07/09 06:57:44 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -64,25 +64,25 @@ tempnam(dir, pfx)
if (issetugid() == 0 && (f = getenv("TMPDIR"))) {
(void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXXXXXX", f,
*(f + strlen(f) - 1) == '/'? "": "/", pfx);
- if (f = _mktemp(name))
+ if ((f = _mktemp(name)))
return(f);
}
- if (f = (char *)dir) {
+ if ((f = (char *)dir)) {
(void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXXXXXX", f,
*(f + strlen(f) - 1) == '/'? "": "/", pfx);
- if (f = _mktemp(name))
+ if ((f = _mktemp(name)))
return(f);
}
f = P_tmpdir;
(void)snprintf(name, MAXPATHLEN, "%s%sXXXXXXXXX", f, pfx);
- if (f = _mktemp(name))
+ if ((f = _mktemp(name)))
return(f);
f = _PATH_TMP;
(void)snprintf(name, MAXPATHLEN, "%s%sXXXXXXXXX", f, pfx);
- if (f = _mktemp(name))
+ if ((f = _mktemp(name)))
return(f);
sverrno = errno;
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c
index b373ea154b2..fa60aafac09 100644
--- a/lib/libc/stdio/ungetc.c
+++ b/lib/libc/stdio/ungetc.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ungetc.c,v 1.2 1996/08/19 08:33:11 tholo Exp $";
+static char rcsid[] = "$OpenBSD: ungetc.c,v 1.3 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -43,15 +43,16 @@ static char rcsid[] = "$OpenBSD: ungetc.c,v 1.2 1996/08/19 08:33:11 tholo Exp $"
#include <string.h>
#include "local.h"
+static int __submore __P((FILE *));
/*
* Expand the ungetc buffer `in place'. That is, adjust fp->_p when
* the buffer moves, so that it points the same distance from the end,
* and move the bytes in the buffer around as necessary so that they
* are all at the end (stack-style).
*/
-static
+static int
__submore(fp)
- register FILE *fp;
+ FILE *fp;
{
register int i;
register unsigned char *p;
@@ -82,6 +83,7 @@ __submore(fp)
return (0);
}
+int
ungetc(c, fp)
int c;
register FILE *fp;
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 2777b04dbba..aef694bfbcc 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: vfprintf.c,v 1.11 2001/05/31 18:11:38 deraadt Exp $";
+static char *rcsid = "$OpenBSD: vfprintf.c,v 1.12 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -740,7 +740,7 @@ number: if ((dprec = prec) >= 0)
ox[0] = *cp++;
ox[1] = '.';
PRINT(ox, 2);
- if (_double || flags & ALT == 0) {
+ if (_double || (flags & ALT) == 0) {
PRINT(cp, ndig-1);
} else /* 0.[0..] */
/* __dtoa irregularity */
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 0a39d8fd0e4..cd533cae684 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.6 1998/01/20 21:25:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.7 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -96,6 +96,7 @@ static u_char *__sccl();
/*
* vfscanf
*/
+int
__svfscanf(fp, fmt0, ap)
register FILE *fp;
char const *fmt0;
diff --git a/lib/libc/stdio/vprintf.c b/lib/libc/stdio/vprintf.c
index f28fb601500..9a65d7ee7ec 100644
--- a/lib/libc/stdio/vprintf.c
+++ b/lib/libc/stdio/vprintf.c
@@ -35,11 +35,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vprintf.c,v 1.2 1996/08/19 08:33:13 tholo Exp $";
+static char rcsid[] = "$OpenBSD: vprintf.c,v 1.3 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+int
vprintf(fmt, ap)
char const *fmt;
_BSD_VA_LIST_ ap;
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 390cc0040ea..76bece1aa35 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -35,11 +35,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vscanf.c,v 1.2 1996/08/19 08:33:13 tholo Exp $";
+static char rcsid[] = "$OpenBSD: vscanf.c,v 1.3 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+int
vscanf(fmt, ap)
const char *fmt;
_BSD_VA_LIST_ ap;
diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c
index 665d9e1de3e..e12be8b53e8 100644
--- a/lib/libc/stdio/vsprintf.c
+++ b/lib/libc/stdio/vsprintf.c
@@ -35,12 +35,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.3 1998/01/12 06:14:32 millert Exp $";
+static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.4 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <limits.h>
+int
vsprintf(str, fmt, ap)
char *str;
const char *fmt;
diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c
index a9b227048e6..c88fb1a5214 100644
--- a/lib/libc/stdio/vsscanf.c
+++ b/lib/libc/stdio/vsscanf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.3 1996/09/15 09:31:47 tholo Exp $";
+static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.4 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -52,6 +52,7 @@ eofread(cookie, buf, len)
return (0);
}
+int
vsscanf(str, fmt, ap)
const char *str;
const char *fmt;
diff --git a/lib/libc/stdio/wbuf.c b/lib/libc/stdio/wbuf.c
index 93f131ae4a6..37604ca06bb 100644
--- a/lib/libc/stdio/wbuf.c
+++ b/lib/libc/stdio/wbuf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: wbuf.c,v 1.4 1997/05/31 22:41:32 tholo Exp $";
+static char rcsid[] = "$OpenBSD: wbuf.c,v 1.5 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -47,6 +47,7 @@ static char rcsid[] = "$OpenBSD: wbuf.c,v 1.4 1997/05/31 22:41:32 tholo Exp $";
* the given file. Flush the buffer out if it is or becomes full,
* or if c=='\n' and the file is line buffered.
*/
+int
__swbuf(c, fp)
register int c;
register FILE *fp;
diff --git a/lib/libc/stdio/wsetup.c b/lib/libc/stdio/wsetup.c
index cc992bdf341..89d560158d7 100644
--- a/lib/libc/stdio/wsetup.c
+++ b/lib/libc/stdio/wsetup.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: wsetup.c,v 1.2 1996/08/19 08:33:16 tholo Exp $";
+static char rcsid[] = "$OpenBSD: wsetup.c,v 1.3 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -47,6 +47,7 @@ static char rcsid[] = "$OpenBSD: wsetup.c,v 1.2 1996/08/19 08:33:16 tholo Exp $"
* because either _flags does not include __SWR, or _buf is NULL.
* _wsetup returns 0 if OK to write, nonzero otherwise.
*/
+int
__swsetup(fp)
register FILE *fp;
{
diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c
index b6f261e61cf..fc7c67a5db6 100644
--- a/lib/libc/stdlib/setenv.c
+++ b/lib/libc/stdlib/setenv.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: setenv.c,v 1.3 1998/02/02 22:44:53 millert Exp $";
+static char *rcsid = "$OpenBSD: setenv.c,v 1.4 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdlib.h>
@@ -62,7 +62,8 @@ setenv(name, value, rewrite)
if (!rewrite)
return (0);
if (strlen(C) >= l_value) { /* old larger; copy over */
- while (*C++ = *value++);
+ while ((*C++ = *value++))
+ ;
return (0);
}
} else { /* create new slot */
@@ -95,7 +96,7 @@ setenv(name, value, rewrite)
return (-1);
for (C = environ[offset]; (*C = *name++) && *C != '='; ++C)
;
- for (*C++ = '='; *C++ = *value++; )
+ for (*C++ = '='; (*C++ = *value++); )
;
return (0);
}
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c
index 9067934da0a..44cc369b16f 100644
--- a/lib/libc/stdlib/strtod.c
+++ b/lib/libc/stdlib/strtod.c
@@ -90,7 +90,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strtod.c,v 1.13 2000/04/30 04:58:22 bjc Exp $";
+static char *rcsid = "$OpenBSD: strtod.c,v 1.14 2001/07/09 06:57:45 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
@@ -395,7 +395,7 @@ Balloc
int x;
Bigint *rv;
- if (rv = freelist[k]) {
+ if ((rv = freelist[k])) {
freelist[k] = rv->next;
}
else {
@@ -643,7 +643,7 @@ mult
xc0 = c->x;
#ifdef Pack_32
for(; xb < xbe; xb++, xc0++) {
- if (y = *xb & 0xffff) {
+ if ((y = *xb & 0xffff)) {
x = xa;
xc = xc0;
carry = 0;
@@ -657,7 +657,7 @@ mult
while(x < xae);
*xc = carry;
}
- if (y = *xb >> 16) {
+ if ((y = *xb >> 16)) {
x = xa;
xc = xc0;
carry = 0;
@@ -708,7 +708,7 @@ pow5mult
int i;
static int p05[3] = { 5, 25, 125 };
- if (i = k & 3)
+ if ((i = k & 3))
b = multadd(b, p05[i-1], 0);
if (!(k >>= 2))
@@ -771,7 +771,7 @@ lshift
z = *x++ >> k1;
}
while(x < xe);
- if (*x1 = z)
+ if ((*x1 = z))
++n1;
}
#else