🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #32

File buffer trashing data?

#32
From: Michael K. Minakami
Date: Mon, 19 Mar 1990 05:40
12 lines
1039 bytes
I'm trying to debug a program and came across something unusal: fwrite()
is changing the contents of an array. The array has memory calloc'ed
for it at the beginning of the program, and when fwrite() is called it 
trashes everything started at array+4. I dereferenced the file pointer and
found a variable (blk?) that was pointing to that location. Also tracing
through fwrite, the array was being changed by a memcpy which (surprise)
copied the data I wanted to fwrite over the array. 

Does anyone know what's going on? 

Thanks
Michael
Technical Details
Message-ID: <1990Mar19.054020.13581@Neon.Stanford.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!shelby!neon!Neon.Stanford.EDU!minakami

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!shelby!neon!Neon.Stanford.EDU!minakami
From: minakami@Neon.Stanford.EDU (Michael K. Minakami)
Newsgroups: comp.sys.ibm.pc.programmer,comp.sys.ibm.pc
Subject: File buffer trashing data?
Message-ID: <1990Mar19.054020.13581@Neon.Stanford.EDU>
Date: 19 Mar 90 05:40:20 GMT
Sender: minakami@Neon.Stanford.EDU (Michael K. Minakami)
Organization: Computer Science Department, Stanford University
Lines: 12