atrun used the fscanf pattern `%*[^\n]' to eat garbage and extra
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 27 Jul 1993 02:08:23 +0000 (18:08 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 27 Jul 1993 02:08:23 +0000 (18:08 -0800)
newlines; it doesn't work with the new stdio
From: Jan-Simon Pendry <pendry@vangogh.CS.Berkeley.EDU>

SCCS-vsn: usr.bin/at/atrun/atrun.c 5.10

usr/src/usr.bin/at/atrun/atrun.c

index de3ce00..d9512de 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)atrun.c    8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)atrun.c    5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -172,10 +172,10 @@ char *spoolfile;
         * Grab the 4-line header out of the spoolfile.
         */
        if (
         * Grab the 4-line header out of the spoolfile.
         */
        if (
-           (fscanf(infile,"# owner: %127s%*[^\n]\n",owner) != 1) ||
-           (fscanf(infile,"# jobname: %127s%*[^\n]\n",jobname) != 1) ||
-           (fscanf(infile,"# shell: %3s%*[^\n]\n",shell) != 1) ||
-           (fscanf(infile,"# notify by mail: %3s%*[^\n]\n",mailvar) != 1)
+           (fscanf(infile,"# owner: %127s\n",owner) != 1) ||
+           (fscanf(infile,"# jobname: %127s\n",jobname) != 1) ||
+           (fscanf(infile,"# shell: %3s\n",shell) != 1) ||
+           (fscanf(infile,"# notify by mail: %3s\n",mailvar) != 1)
            ) {
                fprintf(stderr, "%s: bad spool header\n", spoolfile);
                (void) unlink(spoolfile);
            ) {
                fprintf(stderr, "%s: bad spool header\n", spoolfile);
                (void) unlink(spoolfile);