change second arg of fgets() from size_t to int
This commit is contained in:
parent
d6c3ebedb4
commit
2ef4abe78f
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: stdio.h,v 1.15 1995/03/22 18:17:24 jtc Exp $ */
|
/* $NetBSD: stdio.h,v 1.16 1995/03/25 02:51:02 jtc Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1990 The Regents of the University of California.
|
* Copyright (c) 1990 The Regents of the University of California.
|
||||||
@ -217,7 +217,7 @@ int ferror __P((FILE *));
|
|||||||
int fflush __P((FILE *));
|
int fflush __P((FILE *));
|
||||||
int fgetc __P((FILE *));
|
int fgetc __P((FILE *));
|
||||||
int fgetpos __P((FILE *, fpos_t *));
|
int fgetpos __P((FILE *, fpos_t *));
|
||||||
char *fgets __P((char *, size_t, FILE *));
|
char *fgets __P((char *, int, FILE *));
|
||||||
FILE *fopen __P((const char *, const char *));
|
FILE *fopen __P((const char *, const char *));
|
||||||
int fprintf __P((FILE *, const char *, ...));
|
int fprintf __P((FILE *, const char *, ...));
|
||||||
int fputc __P((int, FILE *));
|
int fputc __P((int, FILE *));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: fgets.c,v 1.4 1995/02/02 02:09:13 jtc Exp $ */
|
/* $NetBSD: fgets.c,v 1.5 1995/03/25 02:50:04 jtc Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1990, 1993
|
* Copyright (c) 1990, 1993
|
||||||
@ -40,7 +40,7 @@
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93";
|
static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93";
|
||||||
#endif
|
#endif
|
||||||
static char rcsid[] = "$NetBSD: fgets.c,v 1.4 1995/02/02 02:09:13 jtc Exp $";
|
static char rcsid[] = "$NetBSD: fgets.c,v 1.5 1995/03/25 02:50:04 jtc Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -54,14 +54,14 @@ static char rcsid[] = "$NetBSD: fgets.c,v 1.4 1995/02/02 02:09:13 jtc Exp $";
|
|||||||
char *
|
char *
|
||||||
fgets(buf, n, fp)
|
fgets(buf, n, fp)
|
||||||
char *buf;
|
char *buf;
|
||||||
register size_t n;
|
register int n;
|
||||||
register FILE *fp;
|
register FILE *fp;
|
||||||
{
|
{
|
||||||
register size_t len;
|
register size_t len;
|
||||||
register char *s;
|
register char *s;
|
||||||
register unsigned char *p, *t;
|
register unsigned char *p, *t;
|
||||||
|
|
||||||
if (n == 0) /* sanity check */
|
if (n <= 0) /* sanity check */
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
s = buf;
|
s = buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user