Article View: comp.sys.atari.st
Article #32556Re: Megamax v1.1 Bug?
From: Tainter
Date: Mon, 16 May 1988 23:25
Date: Mon, 16 May 1988 23:25
22 lines
1491 bytes
1491 bytes
In article <May.12.20.53.04.1988.25733@topaz.rutgers.edu>, 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)? >-- Phil Paone Phil, you are confused. This is UNIX's method. Unix never gives you an argc < 1, since you always have the name of your program in argv[0]. On the ST they stick some fake name in argv[0]. (I patched mine so it always says "stupidity". Go back and unpatch your library! You know, I really hate the fact that argv[0] isn't initialized intelligently! If I get annoyed enough I'll come up with some not quite portable way of getting at the program name, and patch it into my prolog code. --j.a.tainter
Technical Details
Message-ID:
<5365@ihlpg.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!osu-cis!att!ihnp4!ihlpg!tainterReferences:
<May.12.20.53.04.1988.25733@topaz.rutgers.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!osu-cis!att!ihnp4!ihlpg!tainter From: tainter@ihlpg.ATT.COM (Tainter) Newsgroups: comp.sys.atari.st Subject: Re: Megamax v1.1 Bug? Keywords: argc,argv Message-ID: <5365@ihlpg.ATT.COM> Date: 16 May 88 23:25:21 GMT References: <May.12.20.53.04.1988.25733@topaz.rutgers.edu> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 21