Click here to Skip to main content
15,913,090 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fgetc/fputc crashes with long filenames Pin
Michael Dunn18-Nov-06 20:33
sitebuilderMichael Dunn18-Nov-06 20:33 
GeneralRe: fgetc/fputc crashes with long filenames Pin
Steve Echols18-Nov-06 20:36
Steve Echols18-Nov-06 20:36 
GeneralRe: fgetc/fputc crashes with long filenames Pin
chichina18-Nov-06 21:21
chichina18-Nov-06 21:21 
AnswerRe: fgetc/fputc crashes with long filenames Pin
Michael Dunn18-Nov-06 19:17
sitebuilderMichael Dunn18-Nov-06 19:17 
GeneralRe: fgetc/fputc crashes with long filenames Pin
chichina18-Nov-06 19:39
chichina18-Nov-06 19:39 
GeneralRe: fgetc/fputc crashes with long filenames Pin
Steve Echols18-Nov-06 20:02
Steve Echols18-Nov-06 20:02 
GeneralRe: fgetc/fputc crashes with long filenames Pin
chichina18-Nov-06 20:24
chichina18-Nov-06 20:24 
GeneralRe: fgetc/fputc crashes with long filenames Pin
Michael Dunn18-Nov-06 20:31
sitebuilderMichael Dunn18-Nov-06 20:31 
char *cur_dir;
cur_dir=new char;
GetCurrentDirectory(512,cur_dir);
Not sure if this is causing the crash, but that code is wrong - you're only allocating one char but you're telling GetCurrentDirectory() that you allocated 512. This is a buffer overrun bug and GetCurrentDirectory() will end up writing to random memory, which may be corrupting the CRT enough to make fopen() crash.

(BTW, everyone can see the whole thread, this one reply is just fine, welcome to CP Smile | :) )


--Mike--
Visual C++ MVP Cool | :cool:
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

GeneralRe: fgetc/fputc crashes with long filenames Pin
chichina18-Nov-06 20:40
chichina18-Nov-06 20:40 
GeneralRe: fgetc/fputc crashes with long filenames Pin
Steve Echols18-Nov-06 20:34
Steve Echols18-Nov-06 20:34 
AnswerRe: fgetc/fputc crashes with long filenames Pin
Scott Holt20-Nov-06 15:50
Scott Holt20-Nov-06 15:50 
GeneralRe: fgetc/fputc crashes with long filenames Pin
chichina20-Nov-06 16:00
chichina20-Nov-06 16:00 
QuestionHow source codeCRC10 ??? Pin
patter77718-Nov-06 16:49
patter77718-Nov-06 16:49 
QuestionConsole window output [modified] Pin
locoone18-Nov-06 16:01
locoone18-Nov-06 16:01 
AnswerRe: Console window output Pin
Michael Dunn18-Nov-06 16:50
sitebuilderMichael Dunn18-Nov-06 16:50 
AnswerRe: Console window output Pin
tiaozi19-Nov-06 20:52
tiaozi19-Nov-06 20:52 
QuestionLine spacing in an edit box Pin
Sorin Basca18-Nov-06 10:39
Sorin Basca18-Nov-06 10:39 
AnswerRe: Line spacing in an edit box Pin
Mark Salsbery18-Nov-06 13:17
Mark Salsbery18-Nov-06 13:17 
GeneralRe: Line spacing in an edit box Pin
Sorin Basca19-Nov-06 6:03
Sorin Basca19-Nov-06 6:03 
GeneralRe: Line spacing in an edit box Pin
Mark Salsbery19-Nov-06 6:07
Mark Salsbery19-Nov-06 6:07 
Questionclass function pointer to LPVOID Pin
edvintas18-Nov-06 10:16
edvintas18-Nov-06 10:16 
AnswerRe: class function pointer to LPVOID Pin
Waldermort18-Nov-06 10:30
Waldermort18-Nov-06 10:30 
GeneralRe: class function pointer to LPVOID Pin
edvintas18-Nov-06 10:58
edvintas18-Nov-06 10:58 
QuestionNotifications and messages in win app. Pin
sawerr18-Nov-06 9:24
sawerr18-Nov-06 9:24 
AnswerRe: Notifications and messages in win app. Pin
sawerr18-Nov-06 9:36
sawerr18-Nov-06 9:36 

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.