Article View: net.games.pacm
Article #1core dump fix... - (nf)
From: utzoodecvaxpur-eeks
Date: Sat, 19 Jun 1982 01:01
Date: Sat, 19 Jun 1982 01:01
57 lines
1699 bytes
1699 bytes
#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);
> }
Technical Details
Message-ID:
<bnews.pur-ee.357>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
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 Subject: core dump fix... - (nf) Date: Sat, 19 Jun 1982 01:01:41 +0000 Message-ID: <bnews.pur-ee.357>