Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!umn-cs!moll From: moll@umn-cs.CS.UMN.EDU (Rick Moll) Newsgroups: comp.sys.ibm.pc Subject: Compact data model in Turbo C Summary: I can't make malloc work Keywords: Turbo-C C Message-ID: <10040@umn-cs.CS.UMN.EDU> Date: 14 Nov 88 00:19:12 GMT Reply-To: moll@umn-cs.UUCP (Rick Moll) Organization: CSci Dept., University of Minnesota, Mpls. Lines: 25 /* I have a problem with malloc in Borland's Turbo C v1.5. The program below works fine using the Small data model, but hangs my system (I have to reboot) when compiled under the Compact model. I don't do anything different except change the memory model (on the menu) to "Compact" and force a re-compile; the manual says that the linker will automatically pull in the right libraries. Can anyone tell me what I'm doing wrong? Is this program legitimate C code? Can someone with v1.5 try this and see if it does the same thing on your system? How about v2.0? Thanks in advance. */ void main() { void *inbuf; inbuf=(void*) (malloc(100)); strcpy(inbuf, "This text will overwrite something important, no doubt!"); exit(0); } -- Richard J. Moll ...rutgers!umn-cs!moll moll@umn-cs.cs.umn.edu