Bell 32V release
[unix-history] / usr / src / cmd / atrun.c
index e997fad..8b01bef 100644 (file)
@@ -20,7 +20,6 @@ char **argv;
 {
        int tt, day, year, uniq;
        struct direct dirent;
 {
        int tt, day, year, uniq;
        struct direct dirent;
-       char file[DIRSIZ+1];
        FILE *dirf;
 
        chdir(DIR);
        FILE *dirf;
 
        chdir(DIR);
@@ -32,9 +31,7 @@ char **argv;
        while (fread((char *)&dirent, sizeof(dirent), 1, dirf) == 1) {
                if (dirent.d_ino==0)
                        continue;
        while (fread((char *)&dirent, sizeof(dirent), 1, dirf) == 1) {
                if (dirent.d_ino==0)
                        continue;
-               strncpy(file, dirent.d_name, DIRSIZ);
-               file[DIRSIZ] = '\0';
-               if (sscanf(file, "%2d.%3d.%4d.%2d", &year, &day, &tt, &uniq) != 4)
+               if (sscanf(dirent.d_name, "%2d.%3d.%4d.%2d", &year, &day, &tt, &uniq) != 4)
                        continue;
                if (nowyear < year)
                        continue;
                        continue;
                if (nowyear < year)
                        continue;
@@ -42,7 +39,7 @@ char **argv;
                        continue;
                if (nowyear==year && nowdate==day && nowtime < tt)
                        continue;
                        continue;
                if (nowyear==year && nowdate==day && nowtime < tt)
                        continue;
-               run(file);
+               run(dirent.d_name);
        }
        fclose(dirf);
        updatetime(nowtime);
        }
        fclose(dirf);
        updatetime(nowtime);