Posted by Remmie on 2000-04-27
Are you passing a string or a pointer to a string?
Without any code snippets its hard to say.. Can you send in just the
variable & function declarations, function calls and returns (just part
pertaining to calling sending and returning from the functions in question)
Remmie
-----Original Message-----
>Contents:
>Overwting memory ("Gary Lloyd" <glloyd@xxxxxxxx.xxxxx.xxx.xx>)
>
>>
>Date: Thu, 27 Apr 2000 05:40:12 +1000
>From: "Gary Lloyd" <glloyd@xxxxxxxx.xxxxx.xxx.xx>
>Subject: Overwting memory
>
>Hi all, my problem is a fairly simple one Im sure,but after many
frustrating
>weeks,i hav not been able to find a solution to it,basically what i'm doing
>is passing a line of text from a file to a function,that reformats the
>string,in the first pass to the function everything is fine,however in the
>second pass everything is corrupted,that is the string has garbage in
>it,memory has been allocated for it,I hav used memset to what i hoped would
>clear any thing that was there previous,the string passed in is ok,but when
>using strncpy(temp,passed,strlen(passed); it will not even print that at
>using printf(),hope this is sufficient to explain my prob,the code is
rather
>long (500) lines
>Many thanks in anticpation
>Cheers gary
Previous post | Next post | Timeline | Home