Click here to Skip to main content
15,116,516 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange chars Pin
Member 798912228-Apr-20 23:41
MemberMember 798912228-Apr-20 23:41 
GeneralRe: Strange chars Pin
Richard MacCutchan28-Apr-20 23:47
mveRichard MacCutchan28-Apr-20 23:47 
GeneralRe: Strange chars Pin
_Flaviu29-Apr-20 4:10
Member_Flaviu29-Apr-20 4:10 
GeneralRe: Strange chars Pin
Richard MacCutchan29-Apr-20 4:27
mveRichard MacCutchan29-Apr-20 4:27 
GeneralRe: Strange chars Pin
_Flaviu29-Apr-20 5:25
Member_Flaviu29-Apr-20 5:25 
GeneralRe: Strange chars Pin
Richard MacCutchan29-Apr-20 7:07
mveRichard MacCutchan29-Apr-20 7:07 
GeneralRe: Strange chars Pin
k505429-Apr-20 5:21
mvek505429-Apr-20 5:21 
GeneralRe: Strange chars Pin
_Flaviu29-Apr-20 22:05
Member_Flaviu29-Apr-20 22:05 
Yes, indeed, from this point strcat(dir_struct->current_directory, current_file->name);, my dir_struct.directory seem to go crazy.

current_file->name is coming from:

C++
const file_info* current_file = AnotherFunction();


and file_info is a struct defined like this:

C++
typedef struct
	{
		char* name;
		.....
		unsigned int status;
	}file_info;



Here is the steps:

C++
strncpy(dir_struct->directory, "/", sizeof(dir_struct->directory));

TRACE(_T("Directory - %s\n"), dir_struct->directory);	-> Directory - /


Untitled — Postimage.org[^]


C++
const file_info* current_file = AnotherFunction();

TRACE("\n===>>>%s\n", current_file->name);  ->===>>>Unbroken


Untitled2 — Postimage.org[^]

C++
TRACE(_T("Directory - %s\n"), dir_struct->directory);	-> _CrtDbgReport: String too long or IO Error


Untitled — Postimage.org[^]

Untitled — Postimage.org[^]
GeneralRe: Strange chars Pin
Victor Nijegorodov29-Apr-20 23:38
MemberVictor Nijegorodov29-Apr-20 23:38 
GeneralRe: Strange chars Pin
_Flaviu3-May-20 4:35
Member_Flaviu3-May-20 4:35 
GeneralRe: Strange chars Pin
Victor Nijegorodov3-May-20 5:37
MemberVictor Nijegorodov3-May-20 5:37 
GeneralRe: Strange chars Pin
Richard MacCutchan30-Apr-20 0:25
mveRichard MacCutchan30-Apr-20 0:25 
GeneralRe: Strange chars Pin
_Flaviu30-Apr-20 0:34
Member_Flaviu30-Apr-20 0:34 
GeneralRe: Strange chars Pin
Member 798912230-Apr-20 0:50
MemberMember 798912230-Apr-20 0:50 
GeneralRe: Strange chars Pin
_Flaviu30-Apr-20 3:35
Member_Flaviu30-Apr-20 3:35 
GeneralRe: Strange chars Pin
Richard MacCutchan30-Apr-20 1:04
mveRichard MacCutchan30-Apr-20 1:04 
GeneralRe: Strange chars Pin
_Flaviu30-Apr-20 4:01
Member_Flaviu30-Apr-20 4:01 
GeneralRe: Strange chars Pin
Richard MacCutchan30-Apr-20 4:40
mveRichard MacCutchan30-Apr-20 4:40 
QuestionRe: Strange chars Pin
David Crow30-Apr-20 4:50
MemberDavid Crow30-Apr-20 4:50 
AnswerRe: Strange chars Pin
Richard MacCutchan30-Apr-20 5:02
mveRichard MacCutchan30-Apr-20 5:02 
GeneralRe: Strange chars Pin
Victor Nijegorodov30-Apr-20 6:55
MemberVictor Nijegorodov30-Apr-20 6:55 
GeneralRe: Strange chars Pin
Richard MacCutchan30-Apr-20 7:00
mveRichard MacCutchan30-Apr-20 7:00 
GeneralRe: Strange chars Pin
David Crow30-Apr-20 4:50
MemberDavid Crow30-Apr-20 4:50 
GeneralRe: Strange chars Pin
_Flaviu30-Apr-20 7:09
Member_Flaviu30-Apr-20 7:09 
GeneralRe: Strange chars Pin
Member 798912230-Apr-20 18:45
MemberMember 798912230-Apr-20 18:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.