This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: seg fault on file write in cygwin, please help!!!


On Thu, Mar 18, 2004 at 08:35:46PM -0500, scyudits wrote:
> FILE *outfile = fopen("/home/Sophia/ns-allinone-2.27/ns-2.27/myfile.tcl", "w");

     check here if fopen failed (outfile will be NULL)

> fprintf(outfile, "%s", output);
> 
> ...where output is a regular string (character array). 

A string is not a character array.  A string is a null-terminated
sequence of characters.  Does output have a null character at the end?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]