Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAMAGE: after Normal Block

Status
Not open for further replies.

cadbilbao

Programmer
Apr 9, 2001
233
0
0
ES
Hi!

Working with VC++6.0 on NT4.0-SP6a.

I compile this piece of code, without problems:

----//----
char data[3][100];
DOMString value; //XML Type
char *valueT;
...
value = newNode.getNodeValue();
valueT = value.transcode();
...
cout << &quot;NAME =&quot; << valorT << &quot;\n&quot;;
strcpy(data, valueT);
----//----

(NAME = James T.)

But when executing program.exe, a pop-up window
appears:

------------------------------------------------
| DAMAGE: after Normal Block (#59) at 0x00AA1773 |
------------------------------------------------

However, this error depends on the node I am in. It
does not happen in other nodes.

Anybody has experience dealing with this error?
Regards.
 
That's a message saying that your memory is getting corrupted. Maybe there is no null terminator in the string you're copying, and it's overrunning the data array.
 
What happened is that you set the last char to be a &quot;\n&quot; and not a &quot;\0&quot; when you read a string most of the time, you look for a &quot;\0&quot; to tell you when to stop, otherwise, you'll step all over your allocated memory.


Wulf
 
what does strcpy(data, valueT); mean?
1. you copy a char* into a char**. It is an error.
2. Better is to use strncpy where you specify how many symbols you copy.
John Fill
1c.bmp


ivfmd@mail.md
 
Hi Friends,
I had the following error, if you have the solution Please help me...
Damage: after Normal Block (#55) at (memory address)

Siva
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top