Deleted Added
full compact
tty_subs.c (90110) tty_subs.c (90113)
1/*-
2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * SUCH DAMAGE.
36 */
37
38#ifndef lint
39#if 0
40static char sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
41#endif
42static const char rcsid[] =
1/*-
2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * SUCH DAMAGE.
36 */
37
38#ifndef lint
39#if 0
40static char sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
41#endif
42static const char rcsid[] =
43 "$FreeBSD: head/bin/pax/tty_subs.c 90110 2002-02-02 06:48:10Z imp $";
43 "$FreeBSD: head/bin/pax/tty_subs.c 90113 2002-02-02 07:07:59Z imp $";
44#endif /* not lint */
45
46#include <sys/types.h>
47#include <sys/stat.h>
48#include <fcntl.h>
49#include <stdio.h>
50#include <unistd.h>
51#include <stdlib.h>

--- 61 unchanged lines hidden (view full) ---

113 * supplied buffer
114 * Return:
115 * 0 if data was read, -1 otherwise.
116 */
117
118int
119tty_read(char *str, int len)
120{
44#endif /* not lint */
45
46#include <sys/types.h>
47#include <sys/stat.h>
48#include <fcntl.h>
49#include <stdio.h>
50#include <unistd.h>
51#include <stdlib.h>

--- 61 unchanged lines hidden (view full) ---

113 * supplied buffer
114 * Return:
115 * 0 if data was read, -1 otherwise.
116 */
117
118int
119tty_read(char *str, int len)
120{
121 register char *pt;
121 char *pt;
122
123 if ((--len <= 0) || (ttyinf == NULL) || (fgets(str,len,ttyinf) == NULL))
124 return(-1);
125 *(str + len) = '\0';
126
127 /*
128 * strip off that trailing newline
129 */

--- 66 unchanged lines hidden ---
122
123 if ((--len <= 0) || (ttyinf == NULL) || (fgets(str,len,ttyinf) == NULL))
124 return(-1);
125 *(str + len) = '\0';
126
127 /*
128 * strip off that trailing newline
129 */

--- 66 unchanged lines hidden ---