This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: seg fault on file write in cygwin, please help!!!
- From: Yitzchak Scott-Thoennes <sthoenna at efn dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 18 Mar 2004 22:23:48 -0800
- Subject: Re: seg fault on file write in cygwin, please help!!!
- Organization: bs"d
- References: <1079660146.405a4e72c44f0@webmail.mit.edu>
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/