🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1738

This can't be a TurboC bug can it?

#1738
From: CRN
Date: Tue, 31 Jul 1990 16:55
33 lines
1417 bytes
I am having a VERY weird problem in TurboC.  My code looks
something like this:


typedef struct{
   . . .
   char   *str;
int    type;
}FIELD;


int proc(FIELD *fld)
{
   . . .
   if(!valid_str(fld->str))
      return ERROR;
   . . .
}

Here's the weird part.  Using Turbo Debugger I have found that my
program crashes right after this statement.  I perform a watch on
fld, fld->str, fld->type.  Before the call to valid_str() all of the
variables are fine.  Upon return from valid_str(), however, the
pointer, fld, is screwed up which of course in turn screws up
fld->str and fld->type.   I assume that fld is being overwritten
somehow but I can't figure out how.  Valid_str() does nothing to
manipulate fld and the only function that valid_str() calls is
atoi() (yes, I do include stdlib.h).  If anyone has any pointers
for me I'd sure appreciate hearing them.

-- Cory
(crn@byuvm.bitnet)
Technical Details
Message-ID: <90212.105510CRN@BYUVM.BITNET>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!emory!mephisto!psuvax1!psuvm!cunyvm!byuvm!crn
References: <1990Jul30.050221.29945@caen.engin.umich.edu> <1990Jul30.180240.14066@caen.engin.umich.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!emory!mephisto!psuvax1!psuvm!cunyvm!byuvm!crn
From: CRN@BYUVM.BITNET
Newsgroups: comp.os.msdos.programmer
Subject: This can't be a TurboC bug can it?
Message-ID: <90212.105510CRN@BYUVM.BITNET>
Date: 31 Jul 90 16:55:10 GMT
References: <1990Jul30.050221.29945@caen.engin.umich.edu>
 <1990Jul30.180240.14066@caen.engin.umich.edu>
Organization: Brigham Young University
Lines: 33