fgets.c (13545) | fgets.c (14790) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 40 unchanged lines hidden (view full) --- 49/* 50 * Read at most n-1 characters from the given file. 51 * Stop when a newline has been read, or the count runs out. 52 * Return first argument, or NULL if no characters were read. 53 */ 54char * 55fgets(buf, n, fp) 56 char *buf; | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 40 unchanged lines hidden (view full) --- 49/* 50 * Read at most n-1 characters from the given file. 51 * Stop when a newline has been read, or the count runs out. 52 * Return first argument, or NULL if no characters were read. 53 */ 54char * 55fgets(buf, n, fp) 56 char *buf; |
57 register size_t n; | 57 register int n; |
58 register FILE *fp; 59{ 60 register size_t len; 61 register char *s; 62 register unsigned char *p, *t; 63 64 if (n == 0) /* sanity check */ 65 return (NULL); --- 57 unchanged lines hidden --- | 58 register FILE *fp; 59{ 60 register size_t len; 61 register char *s; 62 register unsigned char *p, *t; 63 64 if (n == 0) /* sanity check */ 65 return (NULL); --- 57 unchanged lines hidden --- |