🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.lib.bug
Article #65

(none)

#65
From: atownley
Date: Mon, 20 Jul 1992 22:42
37 lines
1499 bytes
I don't know if this has already come up or not, but I just
installed gcc-2.2.2 and libg++-2.2 today and was trying to
get a project I'm working on to run properly.  When I 
compiled with the new compiler, I get a bus error with the 
following function.  It didn't do this before and I was
wondering if there was something that I didn't know about.

My system configuration is a NeXTcube with NeXTSTEP 2.1
Extended and a 68040 processor.

here is the offending code, taken directly from the module:

void Chapter::WriteChapter()
/* This function writes the chapter database out to the disk in a 
 * binary format so the database maintains its integrity.
 */
{
	FILE *fp;
	char *fileName;
	char *extension = ".tbf";
 		
	cout << "\nEnter the name of the file to save the database under:  ";
	cin >> fileName;
	fileName = strcat(fileName, extension);

	fp = fopen(fileName, "w+b");
	fwrite(&Members, sizeof(Members), 1, fp);
	close(fp);
}

All I am trying to do is get a file extension tacked onto 
the end of the string.  Any ideas?

Thanks,

Andrew S. Townley
atownley@cs.umr.edu
Technical Details
Message-ID: <9207202242.AA07687@next3>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mcs213k.cs.umr.edu!atownley

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.lib.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mcs213k.cs.umr.edu!atownley
From: atownley@mcs213k.cs.umr.edu
Subject: (none)
Message-ID: <9207202242.AA07687@next3>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 20 Jul 1992 22:42:55 GMT
Approved: bug-lib-g++@prep.ai.mit.edu
Lines: 38