*BSD News Article 72361


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!news.sprintlink.net!news-stk-200.sprintlink.net!news.mathworks.com!newsfeed.internetmci.com!uwm.edu!math.ohio-state.edu!jussieu.fr!rain.fr!francenet.fr!itesec!frmug.fr.net!keltia.frmug.fr.net!not-for-mail
From: roberto@keltia.freenix.fr (Ollivier Robert)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: E-mail automatic processing
Date: 28 Jun 1996 23:54:00 GMT
Organization: Usenet Canal Historique
Lines: 34
Message-ID: <4r1rao$r4k@keltia.freenix.fr>
References: <31D39AB9.32E9@host.bemarnet.es>
NNTP-Posting-Host: keltia.freenix.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

 [courtesy cc of this posting sent to cited author via email]

In article <31D39AB9.32E9@host.bemarnet.es>,
Antonio Navarro Navarro  <antonio@host.bemarnet.es> wrote:
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main() {
> 
>   int  x;
>   char ch;
>   file *output;
> 
>   output=fopen("/usr/local/bin/majordomo.txt", "a+");
>   for(x=0;(!feof(stdin));x++) {
>     ch=fgetc(stdin);
>     putc(ch, output);
>   }
>   fclose(output);
>   return(0);
> 
> }
> 
> 
> Any ideas ? Does anybody knows the meaning of the 139 error ?

Yes,   you're getting a    sig11  (128+11=139) which  means a  Segmentation
Violation. You have a problem in the program. 

Try to catch the case where output == NULL...
-- 
Ollivier ROBERT  -=- FreeBSD: The daemon is FREE! -=-  roberto@freebsd.org
-=-=-=-=-=-=-=-=-=-=- FreeBSD 2.x FAQ maintainer -=-=-=-=-=-=-=-=-=-=-=-=-