From: utzoo!decvax!pur-ee!ks
Newsgroups: net.games.pacm
Title: core dump fix... - (nf)
Article-I.D.: pur-ee.357
Posted: Sat Jun 19 01:01:41 1982
Received: Sun Jun 20 00:55:59 1982

#N:pur-ee:5000001:000:1287
pur-ee!ks    Jun 18 17:56:00 1982

Pacman has been core dumping on me lately and I tracked down the reason.
When the high scores are printed, the users login is determined from his
user id.  If the account has been deactivated, it just screws up.  Here
is the simple fix for the file util.h.  Actually any good version of itoa()
should be substituted for this version.  The defunct account shows up as
it's user id as there is no way to determine the user name.

					Kirk Smith
					Purdue EE

30a31,32
> char *itoa();
> 
352,353c353,356
< 				(void) printw("| Player : %-8s  %5u  |", p->pw_name,
< 					scoresave[game - 1].entry[i].score);
---
> 				(void) printw("| Player : %-8s  %5u  |", 
> 				p ? p->pw_name : 
> 				itoa(scoresave[game - 1].entry[i].uid),
> 				scoresave[game - 1].entry[i].score);
822a826,857
> char itoabuf[12];
> char *
> itoa (val)
> {
>     register char  *p;
>     register int    j,
>                     mflag;
> 
>     mflag = 1;
>     for (j = 0; j < 11; j++)
> 	itoabuf[j] = ' ';
>     p = itoabuf + 6;
>     *(p+1) = '\0';
>     if (val == 0)
>     {
> 	*p = '0';
> 	p--;
>     }
>     if (val < 0)
>     {
> 	mflag = -1;
> 	val *= -1;
>     }
>     while (val != 0)
>     {
> 	*p-- = val % 10 + 060;
> 	val /= 10;
>     }
>     if (mflag == -1)
> 	*p-- = '-';
>     return (++p);
> }