🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by cliff Mon, 08 Apr 1985 21:08
wand of core dumping
#417
Author: cliff
Date: Mon, 08 Apr 1985 21:08
12 lines
987 bytes
Lately I haven't been able to get mail to mcvax.  This letter concerns
hack 1.0.  On our SUN, wands of wishing cause core dumps when items are
misspelled.  I found the problem to be related to NROFOBJECTS being defined
improperly.  My quick patch was to change the following line (we are still
running hack 1.0).

436c436
< 	while(i <= NROFOBJECTS && (!let || objects[i].oc_olet == let)){
---
> 	while(objects[i].oc_name && (!let || objects[i].oc_olet == let)){

				--Cliff
Re: wand of core dumping
#423
Author: Andries Brouwer
Date: Wed, 10 Apr 1985 16:28
36 lines
2142 bytes
In article <774@unmvax.UUCP> cliff@unmvax.UUCP writes:
> Lately I haven't been able to get mail to mcvax.  This letter concerns
> hack 1.0.  On our SUN, wands of wishing cause core dumps when items are
> misspelled.  I found the problem to be related to NROFOBJECTS being defined
> improperly.  My quick patch was to change the following line (we are still
> running hack 1.0).
> 
> 436c436
> < 	while(i <= NROFOBJECTS && (!let || objects[i].oc_olet == let)){
> ---
> > 	while(objects[i].oc_name && (!let || objects[i].oc_olet == let)){

Thanks for the bug report; in fact your letter reached me, but perhaps my
reply failed to reach you. Anyway, I don't think there is anything wrong
with NROFOBJECTS, the problem is rather that strcmp(p,q) is done where q
may be 0. Your attempt at a fix only solves part of the problem - a core
dump is still possible - while on the other hand it makes asking for certain
objects impossible. I think the following would be better (the line numbers
are from hack.objnam.c version 1.0.2 but the fix works equally well on
earlier versions).
# diff hack.objnam.c (new)  hack.objnam.c (old)
498,501c498
< 		register char *zn = objects[i].oc_name;
< 
< 		if(!zn) goto nxti;
< 		if(an && strcmp(an, zn))
---
> 		if(an && strcmp(an, objects[i].oc_name))
503c500
< 		if(dn && (!(zn = objects[i].oc_descr) || strcmp(dn, zn)))
---
> 		if(dn && strcmp(dn, objects[i].oc_descr))
505c502
< 		if(un && (!(zn = objects[i].oc_uname) || strcmp(un, zn)))
---
> 		if(un && strcmp(un, objects[i].oc_uname))
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads