- if((fp = fopen(LOGFILE, "r")) == 0) {
- printf("%s: Error opening logfile - %s\n", argv[0], LOGFILE);
- exit(1);
- }
- if (fread(&people, sizeof(people), 1, fp) == 0) {
- printf("%s: Error reading logfile.\n", argv[0]);
- exit(1);
- }
- while ((fread(&flog, sizeof(flog), 1, fp) != 0) && (flog.fname[0] != '\0')) {
- if (usrnam && ((pass = getpwuid(flog.uid)) != NULL))
- sprintf(sbuf, "%10.10s (%s)", flog.fname, pass->pw_name);
- else
- sprintf(sbuf, "%10.10s", flog.fname);
- printf("%-10s %21s of the %15s %3d points, %5.2f equiv\n",
- title[n++], sbuf,
- scene[flog.fgamenum].ship[flog.fshipnum].shipname,
- flog.netpoints,
- (float) flog.netpoints /
- specs[scene[flog.fgamenum].ship[flog.fshipnum].shipnum].pts);
- }
- printf("\n%d people have played.\n", people);