Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 18 Mar 2004 22:23:48 -0800 From: Yitzchak Scott-Thoennes To: cygwin AT cygwin DOT com Subject: Re: seg fault on file write in cygwin, please help!!! Message-ID: <20040319062348.GA3156@efn.org> References: <1079660146 DOT 405a4e72c44f0 AT webmail DOT mit DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1079660146.405a4e72c44f0@webmail.mit.edu> User-Agent: Mutt/1.4i Organization: bs"d X-IsSubscribed: yes 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/