Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!cbmvax!carolyn From: carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) Newsgroups: comp.sys.amiga Subject: Re: Garbage in argv[] w/Lattice C Message-ID: <1042@cbmvax.cbmvax.cbm.UUCP> Date: Wed, 3-Dec-86 09:25:53 EST Article-I.D.: cbmvax.1042 Posted: Wed Dec 3 09:25:53 1986 Date-Received: Thu, 4-Dec-86 09:01:20 EST References: <329@neoucom.UUCP> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner) Organization: Commodore Technology, West Chester, PA Lines: 33 Keywords: Annoyance In article <329@neoucom.UUCP> wtm@neoucom.UUCP (Bill Mayhew) writes: > > I just ran into a minor annoyance with the Lattice C >compiler that we have here at work. If memory stikes me right, >it's version 3.02. > >I discovered that when I read argv[n][n] that the string isn't >always terminated with a \0 as you'd expect. This seems to happen >mostly (if not only) when the string contains ascii characters that >are digits. > Version 3.02 had many problems with pointers to characters. There may also be errors in the startup code's parsing of the command line. Also, if you are doing math inside []'s such as [n+1], this often does not compile correctly in 3.03. The same bug may be present in 3.02. If you are dealing with pointers to chars, don't use 3.02. I have a short program that just echos the args passed to it. It was compiled with 3.03 and uses the LStartup code. It has no problem with ASCII numeric characters. I also fed one of my 3.03 AStartup programs some numeric filenames with no difficulty. I really suspect that 3.02's byte handling bugs are the source of your problem. I think you can take your 3.02 to your dealer for an upgrade to 3.03. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CBM >>Amiga Technical Support<< UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=