Path: utzoo!attcan!uunet!mcvax!ukc!its63b!csan From: csan@its63b.ed.ac.uk (A Ness) Newsgroups: comp.sys.atari.st Subject: Re: Megamax v1.1 Bug? Keywords: argc,argv Message-ID: <1342@its63b.ed.ac.uk> Date: 15 May 88 22:18:17 GMT References: Reply-To: csan@itspna.ed.ac.uk (Andie) Organization: Computer Science Department, Edinburgh University Lines: 26 In article paone@topaz.rutgers.edu (Phil Paone) writes: >> >I have been playing with my v1.1 of Megamax C and found what appears >to be a bug in c lib. argc is being initialized to 1 instead of 0 so >even when no arguments are passed, argc is 1. I went into the library >and patched this up, but the argv also appears to be off. Is this the >case, or is this supposed to be different from UNIX's method of >handling them (Yes, I know argv[0] does not work)? >-- Excuse me if I'm wrong - but isnt it true that you have used an argument - ie. the program name ? In fact I just tried it on two of our Un*x boxes and this is indeed the case - argc should be >=1 argv[0] should be the program name (I know it isnt on the ST),and argv[1]..argv[--argc] contains the arguments. Andie Ness . Department of Computer Science ,Edinburgh University. ARPA: csan%ed.itspna@nss.cs.ucl.ac.uk UUCP: ...!uunet!mcvax!ukc!itspna!csan an%ed.lfcs@nss.cs.ucl.ac.uk JANET: csan@uk.ac.ed.itspna an@uk.ac.ed.lfcs % These are my own views and any resemblance to any coherent reasoning is % probably a typo.