Click here to Skip to main content
15,885,985 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange chars Pin
Victor Nijegorodov30-Apr-20 5:55
Victor Nijegorodov30-Apr-20 5:55 
GeneralRe: Strange chars Pin
Richard MacCutchan30-Apr-20 6:00
mveRichard MacCutchan30-Apr-20 6:00 
GeneralRe: Strange chars Pin
David Crow30-Apr-20 3:50
David Crow30-Apr-20 3:50 
GeneralRe: Strange chars Pin
_Flaviu30-Apr-20 6:09
_Flaviu30-Apr-20 6:09 
GeneralRe: Strange chars Pin
kalberts30-Apr-20 17:45
kalberts30-Apr-20 17:45 
GeneralRe: Strange chars Pin
Richard MacCutchan1-May-20 4:02
mveRichard MacCutchan1-May-20 4:02 
GeneralRe: Strange chars Pin
_Flaviu1-May-20 4:48
_Flaviu1-May-20 4:48 
GeneralRe: Strange chars Pin
_Flaviu3-May-20 5:21
_Flaviu3-May-20 5:21 
Here is what I've discovered by now:

C++
dir_data_t directory_data;
strncpy(directory_data.current_directory, "/", sizeof(directory_data.current_directory));

directory_data is ok by now.

C++
struct list_head* filewalker = NULL;
file_info_t dirlist;
logdir(&directory_data, &dirlist);
INIT_LIST_HEAD(&dirlist.list);
const file_info_t* current_file = NULL;
list_for_each(filewalker, &dirlist.list)
{
	current_file = list_entry_const(filewalker, const file_info_t, list);
	TRACE(_T("current_file->name %s\n"), current_file->name); // ->> now, sometime, current_file->name has a value like that: Oe©*BºcE«Mòצ£š{@Q—Y|†Š˜b!    and from now one, everything goes bad
}

after that,

C++
strcat(directory_data.current_directory, current_file->name);


is not ok, of course. INIT_LIST_HEAD, list_for_each and list_entry_const are Linux functions. logdir functions I could not reproduced in a test app or write here because has many dependencies ... and to be everything more complicated, all this code is written in a recursive function .... is quite difficult to reproduced this situation in a test app ... I am trying to explore logdir function to see what I find there ...
GeneralRe: Strange chars Pin
Richard MacCutchan7-May-20 4:34
mveRichard MacCutchan7-May-20 4:34 
QuestionPassing an array as argument to a function (2) Pin
Calin Negru28-Apr-20 1:16
Calin Negru28-Apr-20 1:16 
AnswerRe: Passing an array as argument to a function (2) Pin
Richard MacCutchan28-Apr-20 2:40
mveRichard MacCutchan28-Apr-20 2:40 
GeneralRe: Passing an array as argument to a function (2) Pin
Calin Negru28-Apr-20 3:08
Calin Negru28-Apr-20 3:08 
GeneralRe: Passing an array as argument to a function (2) Pin
k505428-Apr-20 3:23
mvek505428-Apr-20 3:23 
AnswerRe: Passing an array as argument to a function (2) Pin
Greg Utas28-Apr-20 2:48
professionalGreg Utas28-Apr-20 2:48 
GeneralRe: Passing an array as argument to a function (2) Pin
Calin Negru28-Apr-20 3:36
Calin Negru28-Apr-20 3:36 
GeneralRe: Passing an array as argument to a function (2) Pin
Victor Nijegorodov28-Apr-20 8:49
Victor Nijegorodov28-Apr-20 8:49 
GeneralRe: Passing an array as argument to a function (2) Pin
Calin Negru28-Apr-20 9:54
Calin Negru28-Apr-20 9:54 
GeneralRe: Passing an array as argument to a function (2) Pin
Victor Nijegorodov28-Apr-20 10:22
Victor Nijegorodov28-Apr-20 10:22 
GeneralRe: Passing an array as argument to a function (2) Pin
Calin Negru28-Apr-20 10:45
Calin Negru28-Apr-20 10:45 
GeneralRe: Passing an array as argument to a function (2) Pin
Victor Nijegorodov28-Apr-20 10:58
Victor Nijegorodov28-Apr-20 10:58 
GeneralRe: Passing an array as argument to a function (2) Pin
Calin Negru28-Apr-20 20:59
Calin Negru28-Apr-20 20:59 
GeneralRe: Passing an array as argument to a function (2) Pin
Victor Nijegorodov30-Apr-20 6:13
Victor Nijegorodov30-Apr-20 6:13 
GeneralRe: Passing an array as argument to a function (2) Pin
Calin Negru1-May-20 0:51
Calin Negru1-May-20 0:51 
QuestionParsing the Command Line Pin
Richard Andrew x6426-Apr-20 5:50
professionalRichard Andrew x6426-Apr-20 5:50 
QuestionRe: Parsing the Command Line Pin
David Crow27-Apr-20 1:59
David Crow27-Apr-20 1:59 

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.