fixed order of tgoto args, zapped reliance on former isprint bug
[unix-history] / usr / src / usr.bin / tip / tip.c
index e779cc4..e36593a 100644 (file)
@@ -1,18 +1,29 @@
 /*
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1983 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
 char copyright[] =
  */
 
 #ifndef lint
 char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
+"@(#) Copyright (c) 1983 The Regents of the University of California.\n\
  All rights reserved.\n";
  All rights reserved.\n";
-#endif not lint
+#endif /* not lint */
 
 #ifndef lint
 
 #ifndef lint
-static char sccsid[] = "@(#)tip.c      5.5 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)tip.c      5.8 (Berkeley) %G%";
+#endif /* not lint */
 
 /*
  * tip - UNIX link to other systems
 
 /*
  * tip - UNIX link to other systems
@@ -36,7 +47,6 @@ int   timeout();
 int    cleanup();
 char   *sname();
 char   PNbuf[256];                     /* This limits the size of a number */
 int    cleanup();
 char   *sname();
 char   PNbuf[256];                     /* This limits the size of a number */
-extern char *sprintf();
 
 main(argc, argv)
        char *argv[];
 
 main(argc, argv)
        char *argv[];
@@ -103,7 +113,8 @@ main(argc, argv)
        for (p = system; *p; p++)
                *p = '\0';
        PN = PNbuf;
        for (p = system; *p; p++)
                *p = '\0';
        PN = PNbuf;
-       system = sprintf(sbuf, "tip%d", BR);
+       (void)sprintf(sbuf, "tip%d", BR);
+       system = sbuf;
 
 notnumber:
        signal(SIGINT, cleanup);
 
 notnumber:
        signal(SIGINT, cleanup);
@@ -117,7 +128,7 @@ notnumber:
        }
        if (i == -1) {
                printf("link down\n");
        }
        if (i == -1) {
                printf("link down\n");
-               delock(uucplock);
+               (void)uu_unlock(uucplock);
                exit(3);
        }
        setbuf(stdout, NULL);
                exit(3);
        }
        setbuf(stdout, NULL);
@@ -133,7 +144,7 @@ notnumber:
        setparity("even");                      /* set the parity table */
        if ((i = speed(number(value(BAUDRATE)))) == NULL) {
                printf("tip: bad baud rate %d\n", number(value(BAUDRATE)));
        setparity("even");                      /* set the parity table */
        if ((i = speed(number(value(BAUDRATE)))) == NULL) {
                printf("tip: bad baud rate %d\n", number(value(BAUDRATE)));
-               delock(uucplock);
+               (void)uu_unlock(uucplock);
                exit(3);
        }
 
                exit(3);
        }
 
@@ -156,7 +167,7 @@ notnumber:
        if (p = connect()) {
                printf("\07%s\n[EOT]\n", p);
                daemon_uid();
        if (p = connect()) {
                printf("\07%s\n[EOT]\n", p);
                daemon_uid();
-               delock(uucplock);
+               (void)uu_unlock(uucplock);
                exit(1);
        }
        if (!HW)
                exit(1);
        }
        if (!HW)
@@ -202,7 +213,7 @@ cleanup()
 {
 
        daemon_uid();
 {
 
        daemon_uid();
-       delock(uucplock);
+       (void)uu_unlock(uucplock);
        if (odisc)
                ioctl(0, TIOCSETD, (char *)&odisc);
        exit(0);
        if (odisc)
                ioctl(0, TIOCSETD, (char *)&odisc);
        exit(0);