use fgets, not gets
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 21 Nov 1988 11:11:02 +0000 (03:11 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 21 Nov 1988 11:11:02 +0000 (03:11 -0800)
SCCS-vsn: usr.sbin/lpr/lpc/lpc.c 5.7

usr/src/usr.sbin/lpr/lpc/lpc.c

index c1169ac..0f8a010 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)lpc.c      5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)lpc.c      5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -105,7 +105,7 @@ cmdscanner(top)
                        printf("lpc> ");
                        fflush(stdout);
                }
                        printf("lpc> ");
                        fflush(stdout);
                }
-               if (gets(cmdline) == 0)
+               if (fgets(cmdline, sizeof(cmdline), stdin) == 0)
                        quit();
                if (cmdline[0] == 0)
                        break;
                        quit();
                if (cmdline[0] == 0)
                        break;