View Single Post
Old 13 January 2021, 23:11   #2
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 5,204
Code:
fl->fileName = (STRPTR)fib->fib_FileName;
that copies the pointer, which may be used for something else in the meantime. You have to duplicate the string.

change your structure so fileName is a char fileName[108] then you can strcpy(fl->fileName,(STRPTR)fib->fib_FileName)

or malloc the exact string size (+1) and same string copy (needs deallocation in the end)
jotd is offline  
 
Page generated in 0.08630 seconds with 11 queries