Article View: comp.sys.atari.st
Article #32697Re: Megamax v1.1 Bug?
From: Bob Argyle
Date: Sat, 21 May 1988 00:37
Date: Sat, 21 May 1988 00:37
18 lines
1223 bytes
1223 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.
...
> Phil Paone
...
> "Admiral...There be whales here"
There is apparently one unusable argument passed, the name of the
program. argv[1] _always_ is the first argument after the program name.
So argc = 2 so one can for (i=1;i<argc;i++) printf("%s\n",argv[i]);
instead of kluging for (i=1;i<argc+1;i++)... to get the list.
^^
If it ain't broke ... when all else fails ...
Bob @ wsccs
Technical Details
Message-ID:
<544@wsccs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!oodis01!uplherc!sp7040!obie!wsccs!rargyleReferences:
<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!oodis01!uplherc!sp7040!obie!wsccs!rargyle From: rargyle@wsccs.UUCP (Bob Argyle) Newsgroups: comp.sys.atari.st Subject: Re: Megamax v1.1 Bug? Summary: first argument is program name Keywords: argc,argv Message-ID: <544@wsccs.UUCP> Date: 21 May 88 00:37:10 GMT References: <May.12.20.53.04.1988.25733@topaz.rutgers.edu> Lines: 17