diff options
| author | christos <christos@NetBSD.org> | 1998-11-15 17:19:53 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 1998-11-15 17:19:53 +0000 |
| commit | e7f7fdba9a2ceba2e63bb84ca8a38c2624b7bf1c (patch) | |
| tree | 0ed0e8a0dad82e3eb6e4c7fc56536932a52f2740 /lib | |
| parent | d1d407360d0bc6cf5fec4853bcdfb05489194cac (diff) | |
delint
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/stdio/asprintf.c | 6 | ||||
| -rw-r--r-- | lib/libc/stdio/fgetln.c | 8 | ||||
| -rw-r--r-- | lib/libc/stdio/findfp.c | 6 | ||||
| -rw-r--r-- | lib/libc/stdio/fputs.c | 5 | ||||
| -rw-r--r-- | lib/libc/stdio/fseek.c | 10 | ||||
| -rw-r--r-- | lib/libc/stdio/ftell.c | 8 | ||||
| -rw-r--r-- | lib/libc/stdio/funopen.c | 5 | ||||
| -rw-r--r-- | lib/libc/stdio/fvwrite.c | 10 | ||||
| -rw-r--r-- | lib/libc/stdio/fwrite.c | 5 | ||||
| -rw-r--r-- | lib/libc/stdio/perror.c | 10 | ||||
| -rw-r--r-- | lib/libc/stdio/puts.c | 5 | ||||
| -rw-r--r-- | lib/libc/stdio/setbuffer.c | 6 | ||||
| -rw-r--r-- | lib/libc/stdio/sscanf.c | 5 | ||||
| -rw-r--r-- | lib/libc/stdio/stdio.c | 8 | ||||
| -rw-r--r-- | lib/libc/stdio/tempnam.c | 6 | ||||
| -rw-r--r-- | lib/libc/stdio/ungetc.c | 6 | ||||
| -rw-r--r-- | lib/libc/stdio/vasprintf.c | 6 | ||||
| -rw-r--r-- | lib/libc/stdio/vfscanf.c | 12 | ||||
| -rw-r--r-- | lib/libc/stdio/vsscanf.c | 5 |
19 files changed, 71 insertions, 61 deletions
diff --git a/lib/libc/stdio/asprintf.c b/lib/libc/stdio/asprintf.c index aacd315858f..d6345b8bea6 100644 --- a/lib/libc/stdio/asprintf.c +++ b/lib/libc/stdio/asprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: asprintf.c,v 1.3 1998/10/15 07:36:09 mycroft Exp $ */ +/* $NetBSD: asprintf.c,v 1.4 1998/11/15 17:19:53 christos Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -29,7 +29,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: asprintf.c,v 1.3 1998/10/15 07:36:09 mycroft Exp $"); +__RCSID("$NetBSD: asprintf.c,v 1.4 1998/11/15 17:19:53 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -71,7 +71,7 @@ asprintf(str, fmt, va_alist) goto err; *f._p = '\0'; va_end(ap); - _base = realloc(f._bf._base, ret + 1); + _base = realloc(f._bf._base, (size_t)(ret + 1)); if (_base == NULL) goto err; *str = (char *)_base; diff --git a/lib/libc/stdio/fgetln.c b/lib/libc/stdio/fgetln.c index bc6a7df68ea..fd293fdd2f9 100644 --- a/lib/libc/stdio/fgetln.c +++ b/lib/libc/stdio/fgetln.c @@ -1,4 +1,4 @@ -/* $NetBSD: fgetln.c,v 1.6 1998/10/16 12:39:54 kleink Exp $ */ +/* $NetBSD: fgetln.c,v 1.7 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)fgetline.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: fgetln.c,v 1.6 1998/10/16 12:39:54 kleink Exp $"); +__RCSID("$NetBSD: fgetln.c,v 1.7 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -110,7 +110,7 @@ fgetln(fp, lenp) } /* look for a newline in the input */ - if ((p = memchr((void *)fp->_p, '\n', fp->_r)) != NULL) { + if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) != NULL) { char *ret; /* @@ -153,7 +153,7 @@ fgetln(fp, lenp) off = len; if (__srefill(fp)) break; /* EOF or error: return partial line */ - if ((p = memchr((void *)fp->_p, '\n', fp->_r)) == NULL) + if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) == NULL) continue; /* got it: finish up the line (like code above) */ diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index caebe153a8d..92d6e4412f7 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -1,4 +1,4 @@ -/* $NetBSD: findfp.c,v 1.11 1998/10/18 13:56:22 kleink Exp $ */ +/* $NetBSD: findfp.c,v 1.12 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94"; #else -__RCSID("$NetBSD: findfp.c,v 1.11 1998/10/18 13:56:22 kleink Exp $"); +__RCSID("$NetBSD: findfp.c,v 1.12 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -93,7 +93,7 @@ moreglue(n) g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE)); if (g == NULL) return (NULL); - p = (FILE *)ALIGN(g + 1); + p = (FILE *)ALIGN((u_long)(g + 1)); g->next = NULL; g->niobs = n; g->iobs = p; diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c index 1ad5d33ac9c..4a19225b88a 100644 --- a/lib/libc/stdio/fputs.c +++ b/lib/libc/stdio/fputs.c @@ -1,4 +1,4 @@ -/* $NetBSD: fputs.c,v 1.7 1998/01/19 07:38:46 jtc Exp $ */ +/* $NetBSD: fputs.c,v 1.8 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: fputs.c,v 1.7 1998/01/19 07:38:46 jtc Exp $"); +__RCSID("$NetBSD: fputs.c,v 1.8 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -62,6 +62,7 @@ fputs(s, fp) struct __siov iov; int r; + /* LINTED we don't touch s */ iov.iov_base = (void *)s; iov.iov_len = uio.uio_resid = strlen(s); uio.uio_iov = &iov; diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c index 3f2b09c5511..ddf4f635132 100644 --- a/lib/libc/stdio/fseek.c +++ b/lib/libc/stdio/fseek.c @@ -1,4 +1,4 @@ -/* $NetBSD: fseek.c,v 1.15 1998/09/06 16:37:27 kleink Exp $ */ +/* $NetBSD: fseek.c,v 1.16 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)fseek.c 8.3 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: fseek.c,v 1.15 1998/09/06 16:37:27 kleink Exp $"); +__RCSID("$NetBSD: fseek.c,v 1.16 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -121,7 +121,7 @@ fseek(fp, offset, whence) } else if (fp->_flags & __SWR && fp->_p != NULL) curoff += fp->_p - fp->_bf._base; - offset += curoff; + offset += (long)curoff; whence = SEEK_SET; havepos = 1; break; @@ -211,7 +211,7 @@ fseek(fp, offset, whence) */ if ((fp->_flags & __SMOD) == 0 && target >= curoff && target < curoff + n) { - int o = target - curoff; + int o = (int)(target - curoff); fp->_p = fp->_bf._base + o; fp->_r = n - o; @@ -238,7 +238,7 @@ fseek(fp, offset, whence) if (HASUB(fp)) FREEUB(fp); fp->_flags &= ~__SEOF; - n = target - curoff; + n = (int)(target - curoff); if (n) { if (__srefill(fp) || fp->_r < n) goto dumb; diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c index a63a7124365..d9dc018aa10 100644 --- a/lib/libc/stdio/ftell.c +++ b/lib/libc/stdio/ftell.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftell.c,v 1.10 1998/02/03 18:41:14 perry Exp $ */ +/* $NetBSD: ftell.c,v 1.11 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)ftell.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: ftell.c,v 1.10 1998/02/03 18:41:14 perry Exp $"); +__RCSID("$NetBSD: ftell.c,v 1.11 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -78,7 +78,7 @@ ftell(fp) pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR); if (pos == -1L) { FUNLOCKFILE(fp); - return (pos); + return (long)(pos); } } if (fp->_flags & __SRD) { @@ -99,5 +99,5 @@ ftell(fp) pos += fp->_p - fp->_bf._base; } FUNLOCKFILE(fp); - return (pos); + return (long)(pos); } diff --git a/lib/libc/stdio/funopen.c b/lib/libc/stdio/funopen.c index 2b20dd1cb6b..872ff1e0906 100644 --- a/lib/libc/stdio/funopen.c +++ b/lib/libc/stdio/funopen.c @@ -1,4 +1,4 @@ -/* $NetBSD: funopen.c,v 1.6 1998/02/03 18:41:15 perry Exp $ */ +/* $NetBSD: funopen.c,v 1.7 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: funopen.c,v 1.6 1998/02/03 18:41:15 perry Exp $"); +__RCSID("$NetBSD: funopen.c,v 1.7 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -76,6 +76,7 @@ funopen(cookie, readfn, writefn, seekfn, closefn) return (NULL); fp->_flags = flags; fp->_file = -1; + /* LINTED we don't play with cookie */ fp->_cookie = (void *)cookie; fp->_read = readfn; fp->_write = writefn; diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c index 27745efc095..450e93a7856 100644 --- a/lib/libc/stdio/fvwrite.c +++ b/lib/libc/stdio/fvwrite.c @@ -1,4 +1,4 @@ -/* $NetBSD: fvwrite.c,v 1.10 1998/10/15 07:10:38 mycroft Exp $ */ +/* $NetBSD: fvwrite.c,v 1.11 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)fvwrite.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: fvwrite.c,v 1.10 1998/10/15 07:10:38 mycroft Exp $"); +__RCSID("$NetBSD: fvwrite.c,v 1.11 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -98,7 +98,8 @@ __sfvwrite(fp, uio) */ do { GETIOV(;); - w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ)); + w = (*fp->_write)(fp->_cookie, p, + (int)MIN(len, BUFSIZ)); if (w <= 0) goto err; p += w; @@ -129,7 +130,8 @@ __sfvwrite(fp, uio) do { _size = (_size << 1) + 1; } while (_size < blen + len); - _base = realloc(fp->_bf._base, _size + 1); + _base = realloc(fp->_bf._base, + (size_t)(_size + 1)); if (_base == NULL) goto err; fp->_w += _size - fp->_bf._size; diff --git a/lib/libc/stdio/fwrite.c b/lib/libc/stdio/fwrite.c index 405627cd254..59f992ebc20 100644 --- a/lib/libc/stdio/fwrite.c +++ b/lib/libc/stdio/fwrite.c @@ -1,4 +1,4 @@ -/* $NetBSD: fwrite.c,v 1.7 1998/01/19 07:38:49 jtc Exp $ */ +/* $NetBSD: fwrite.c,v 1.8 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)fwrite.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: fwrite.c,v 1.7 1998/01/19 07:38:49 jtc Exp $"); +__RCSID("$NetBSD: fwrite.c,v 1.8 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -64,6 +64,7 @@ fwrite(buf, size, count, fp) struct __suio uio; struct __siov iov; + /* LINTED we don't play with buf */ iov.iov_base = (void *)buf; uio.uio_resid = iov.iov_len = n = count * size; uio.uio_iov = &iov; diff --git a/lib/libc/stdio/perror.c b/lib/libc/stdio/perror.c index f4674f78b80..229460a9a08 100644 --- a/lib/libc/stdio/perror.c +++ b/lib/libc/stdio/perror.c @@ -1,4 +1,4 @@ -/* $NetBSD: perror.c,v 1.16 1998/09/09 12:15:55 kleink Exp $ */ +/* $NetBSD: perror.c,v 1.17 1998/11/15 17:19:53 christos Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)perror.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: perror.c,v 1.16 1998/09/09 12:15:55 kleink Exp $"); +__RCSID("$NetBSD: perror.c,v 1.17 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -75,6 +75,7 @@ perror(s) v = iov; if (s && *s) { + /* LINTED we don't touch the string */ v->iov_base = (void *)s; v->iov_len = strlen(s); v++; @@ -82,10 +83,11 @@ perror(s) v->iov_len = 2; v++; } - v->iov_base = (void *)__strerror(errno, buf, sizeof(buf)); v->iov_len = strlen(v->iov_base); + /* LINTED we don't touch the string */ + v->iov_base = (void *)__strerror(errno, buf, sizeof(buf)); v++; - v->iov_base = "\n"; v->iov_len = 1; + v->iov_base = "\n"; (void)writev(STDERR_FILENO, iov, (v - iov) + 1); } diff --git a/lib/libc/stdio/puts.c b/lib/libc/stdio/puts.c index f1e5e3e0da1..d99286348ff 100644 --- a/lib/libc/stdio/puts.c +++ b/lib/libc/stdio/puts.c @@ -1,4 +1,4 @@ -/* $NetBSD: puts.c,v 1.7 1998/09/07 14:37:13 kleink Exp $ */ +/* $NetBSD: puts.c,v 1.8 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)puts.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: puts.c,v 1.7 1998/09/07 14:37:13 kleink Exp $"); +__RCSID("$NetBSD: puts.c,v 1.8 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -62,6 +62,7 @@ puts(s) struct __siov iov[2]; int r; + /* LINTED we don't touch the string */ iov[0].iov_base = (void *)s; iov[0].iov_len = c; iov[1].iov_base = "\n"; diff --git a/lib/libc/stdio/setbuffer.c b/lib/libc/stdio/setbuffer.c index e4f93dc1c50..b30d8c8d503 100644 --- a/lib/libc/stdio/setbuffer.c +++ b/lib/libc/stdio/setbuffer.c @@ -1,4 +1,4 @@ -/* $NetBSD: setbuffer.c,v 1.6 1998/02/03 18:41:21 perry Exp $ */ +/* $NetBSD: setbuffer.c,v 1.7 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)setbuffer.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: setbuffer.c,v 1.6 1998/02/03 18:41:21 perry Exp $"); +__RCSID("$NetBSD: setbuffer.c,v 1.7 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -54,7 +54,7 @@ setbuffer(fp, buf, size) int size; { - (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, size); + (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, (size_t)size); } /* diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c index 4595ee6a245..ea794b4dfbd 100644 --- a/lib/libc/stdio/sscanf.c +++ b/lib/libc/stdio/sscanf.c @@ -1,4 +1,4 @@ -/* $NetBSD: sscanf.c,v 1.8 1997/07/13 20:15:29 christos Exp $ */ +/* $NetBSD: sscanf.c,v 1.9 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)sscanf.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: sscanf.c,v 1.8 1997/07/13 20:15:29 christos Exp $"); +__RCSID("$NetBSD: sscanf.c,v 1.9 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -82,6 +82,7 @@ sscanf(str, fmt, va_alist) FILE f; f._flags = __SRD; + /* LINTED we don't touch the string */ f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._r = strlen(str); f._read = eofread; diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c index 7a4c605d14f..e7b4a227b34 100644 --- a/lib/libc/stdio/stdio.c +++ b/lib/libc/stdio/stdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: stdio.c,v 1.8 1998/10/14 11:56:29 kleink Exp $ */ +/* $NetBSD: stdio.c,v 1.9 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)stdio.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: stdio.c,v 1.8 1998/10/14 11:56:29 kleink Exp $"); +__RCSID("$NetBSD: stdio.c,v 1.9 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -64,7 +64,7 @@ __sread(cookie, buf, n) FILE *fp = cookie; int ret; - ret = read(fp->_file, buf, n); + ret = read(fp->_file, buf, (size_t)n); /* if the read succeeded, update the current offset */ if (ret >= 0) fp->_offset += ret; @@ -84,7 +84,7 @@ __swrite(cookie, buf, n) if (fp->_flags & __SAPP) (void) lseek(fp->_file, (off_t)0, SEEK_END); fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */ - return (write(fp->_file, buf, n)); + return (write(fp->_file, buf, (size_t)n)); } fpos_t diff --git a/lib/libc/stdio/tempnam.c b/lib/libc/stdio/tempnam.c index 1ff81ce8550..f1c27d15131 100644 --- a/lib/libc/stdio/tempnam.c +++ b/lib/libc/stdio/tempnam.c @@ -1,4 +1,4 @@ -/* $NetBSD: tempnam.c,v 1.12 1998/10/13 14:19:21 kleink Exp $ */ +/* $NetBSD: tempnam.c,v 1.13 1998/11/15 17:19:53 christos Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tempnam.c,v 1.12 1998/10/13 14:19:21 kleink Exp $"); +__RCSID("$NetBSD: tempnam.c,v 1.13 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -75,7 +75,7 @@ tempnam(dir, pfx) return(f); } - if ((f = (char *)dir) != NULL) { + if ((/* LINTED */f = (char *)dir) != NULL) { (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXXX", f, *(f + strlen(f) - 1) == '/'? "": "/", pfx); if ((f = _mktemp(name)) != NULL) diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c index 4bc0f4be1a2..8633fc7047d 100644 --- a/lib/libc/stdio/ungetc.c +++ b/lib/libc/stdio/ungetc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ungetc.c,v 1.8 1998/09/07 14:37:13 kleink Exp $ */ +/* $NetBSD: ungetc.c,v 1.9 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)ungetc.c 8.2 (Berkeley) 11/3/93"; #else -__RCSID("$NetBSD: ungetc.c,v 1.8 1998/09/07 14:37:13 kleink Exp $"); +__RCSID("$NetBSD: ungetc.c,v 1.9 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -80,7 +80,7 @@ __submore(fp) return (0); } i = fp->_ub._size; - p = realloc(fp->_ub._base, i << 1); + p = realloc(fp->_ub._base, (size_t)(i << 1)); if (p == NULL) return (EOF); /* no overlap (hence can use memcpy) because we doubled the size */ diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c index 3b0f5bda4e7..67c0e6e0daf 100644 --- a/lib/libc/stdio/vasprintf.c +++ b/lib/libc/stdio/vasprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vasprintf.c,v 1.3 1998/10/15 07:36:09 mycroft Exp $ */ +/* $NetBSD: vasprintf.c,v 1.4 1998/11/15 17:19:53 christos Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -29,7 +29,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vasprintf.c,v 1.3 1998/10/15 07:36:09 mycroft Exp $"); +__RCSID("$NetBSD: vasprintf.c,v 1.4 1998/11/15 17:19:53 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -55,7 +55,7 @@ vasprintf(str, fmt, ap) if (ret == -1) goto err; *f._p = '\0'; - _base = realloc(f._bf._base, ret + 1); + _base = realloc(f._bf._base, (size_t)(ret + 1)); if (_base == NULL) goto err; *str = (char *)_base; diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index 48f9f34ef15..505b1758dbc 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfscanf.c,v 1.21 1998/10/25 18:25:43 kleink Exp $ */ +/* $NetBSD: vfscanf.c,v 1.22 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vfscanf.c,v 1.21 1998/10/25 18:25:43 kleink Exp $"); +__RCSID("$NetBSD: vfscanf.c,v 1.22 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -110,7 +110,7 @@ __svfscanf(fp, fmt0, ap) const char *fmt0; _BSD_VA_LIST_ ap; { - const u_char *fmt = fmt0; + const u_char *fmt = (const u_char *)fmt0; int c; /* character from format, or conversion */ size_t width; /* field width, or 0 */ char *p; /* points into all kinds of strings */ @@ -557,11 +557,11 @@ literal: else if (flags & QUAD) *va_arg(ap, quad_t *) = res; else if (flags & LONG) - *va_arg(ap, long *) = res; + *va_arg(ap, long *) = (long)res; else if (flags & SHORT) - *va_arg(ap, short *) = res; + *va_arg(ap, short *) = (short)res; else - *va_arg(ap, int *) = res; + *va_arg(ap, int *) = (int)res; nassigned++; } nread += p - buf; diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c index 1caaef893b7..5b07538032e 100644 --- a/lib/libc/stdio/vsscanf.c +++ b/lib/libc/stdio/vsscanf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vsscanf.c,v 1.7 1997/07/13 20:15:38 christos Exp $ */ +/* $NetBSD: vsscanf.c,v 1.8 1998/11/15 17:19:53 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)vsscanf.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vsscanf.c,v 1.7 1997/07/13 20:15:38 christos Exp $"); +__RCSID("$NetBSD: vsscanf.c,v 1.8 1998/11/15 17:19:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -69,6 +69,7 @@ vsscanf(str, fmt, ap) FILE f; f._flags = __SRD; + /* LINTED we don't touch str */ f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._r = strlen(str); f._read = eofread; |
